/* ==========================================================================
   Arenyze UI — network core

   The shared layer every Arenyze tracker is built on: tokens, layout and
   components. Nothing in here is specific to one game. A tracker sets its
   identity in theme.css (accent, display type, shapes, backdrop) and its
   page layouts in pages.css.

   Layers, lowest first, so a theme or a page always wins without !important.
   ========================================================================== */
@layer reset, tokens, base, layout, components, utilities;

/* ---------------------------------------------------------------- tokens -- */
@layer tokens {
  :root {
    color-scheme: dark;

    /* surfaces: near-black, each step a little lifted */
    --bg: #07070a;
    --bg-2: #0b0b0f;
    --s1: #101015;
    --s2: #15151c;
    --s3: #1c1c25;
    --s4: #262631;
    --s5: #31313e;
    --line: #ffffff0f;
    --line-2: #ffffff1a;
    --line-3: #ffffff2b;
    --glass: #0d0d12d9;

    /* ink */
    --ink: #f6f6f8;
    --ink-2: #c6c6d2;
    --ink-3: #9393a1;
    --ink-4: #6a6a77;

    /* brand slots — a theme fills these */
    --acc: #6e7bff;
    --acc-hi: #8d97ff;
    --acc-lo: #4c58e0;
    --acc-ink: #ffffff;
    --acc-rgb: 110 123 255;
    --hi: #ffd84a;            /* second voice: highlights, podium, cash */
    --hi-ink: #16130a;

    /* data */
    --up: #2fe08a;
    --down: #ff4d5e;
    --info: #49a9ff;
    --gold: #ffcf3f;
    --silver: #c9d1dc;
    --bronze: #d58b55;

    /* league tiers */
    --t-bronze: #cd8a55;
    --t-silver: #c5ccd6;
    --t-gold: #f3c34a;
    --t-platinum: #49d7c4;
    --t-diamond: #6cc6ff;
    --t-ruby: #ff4d6d;

    /* type */
    --f-ui: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --f-display: 'Archivo', 'Geist', ui-sans-serif, system-ui, sans-serif;
    --f-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --display-stretch: 112%;     /* headings */
    --num-stretch: 72%;          /* figures */

    /* shape */
    --r-xs: 4px;
    --r-sm: 7px;
    --r: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --cut: 0px;                 /* a theme can clip a corner off panels */

    /* rhythm */
    --maxw: 1380px;
    --gut: clamp(16px, 3vw, 28px);
    --hdr-h: 60px;
    --tick-h: 0px;
    --tabbar-h: 0px;

    /* motion */
    --ease: cubic-bezier(.2, .8, .2, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-io: cubic-bezier(.65, 0, .35, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
    --t-fast: .14s;
    --t: .24s;
    --t-slow: .5s;

    /* depth */
    --edge: inset 0 1px 0 #ffffff0a;
    --shadow-1: 0 1px 2px #0006, 0 4px 14px -6px #0008;
    --shadow-2: 0 18px 50px -14px #000c, 0 0 0 1px var(--line-2);
    --shadow-pop: 0 30px 80px -20px #000e, 0 0 0 1px var(--line-2);

    --z-hdr: 1000;
    --z-pop: 1100;
    --z-modal: 1200;
    --z-toast: 1300;
  }
  @media (max-width: 860px) {
    :root { --hdr-h: 56px; --tabbar-h: 64px; }
  }
}

/* ----------------------------------------------------------------- reset -- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; padding: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  img, svg, video, canvas { display: block; max-width: 100%; }
  img { height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  button { background: none; border: 0; cursor: pointer; }
  a { color: inherit; text-decoration: none; }
  ol, ul { list-style: none; }
  table { border-collapse: collapse; border-spacing: 0; }
  [hidden] { display: none !important; }
  :where(h1, h2, h3, h4, h5, h6) { font-weight: inherit; font-size: inherit; }
}

/* ------------------------------------------------------------------ base -- */
@layer base {
  html {
    background: var(--bg);
    scroll-padding-top: calc(var(--hdr-h) + var(--tick-h) + 24px);
    scrollbar-color: var(--s5) transparent;
    scrollbar-width: thin;
  }
  body {
    min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column;
    background: var(--bg);
    color: var(--ink);
    font: 400 14px/1.55 var(--f-ui);
    font-feature-settings: 'ss01', 'cv11';
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    padding-bottom: var(--tabbar-h);
  }
  body > main { flex: 1 0 auto; width: 100%; position: relative; isolation: isolate; min-height: calc(100vh - var(--hdr-h)); min-height: calc(100dvh - var(--hdr-h)); }

  /* film grain over everything: kills banding in the big gradients and gives the
     flat surfaces a little tooth. Pointer-transparent, below popovers. */
  body::after {
    content: ''; position: fixed; inset: 0; z-index: 900; pointer-events: none;
    opacity: .045; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  ::selection { background: rgb(var(--acc-rgb) / .38); color: #fff; }
  :focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 4px; }
  a:hover { color: var(--ink); }
  b, strong { font-weight: 650; }
  small { font-size: .8em; }
  code, kbd { font-family: var(--f-mono); font-size: .86em; }
  hr { border: 0; height: 1px; background: var(--line); margin: 20px 0; }
  .tnum, .num { font-variant-numeric: tabular-nums; }

  /* Icons: an SVG sprite (<svg class="i"><use href="…#name"></svg>). Legacy
     ligature spans are upgraded by app.js; until then they keep their box and
     show nothing. */
  .i { width: 1.15em; height: 1.15em; flex: none; fill: currentColor; display: inline-block; vertical-align: -.2em; }
  .material-icons, .msr {
    display: inline-block; width: 1.15em; height: 1.15em; flex: none;
    overflow: hidden; font-size: inherit; line-height: 1; vertical-align: -.2em;
    font-family: inherit; font-style: normal;
  }
  /* On this site the span stays and the icon is drawn inside it (ui-core.js);
     only its name is hidden, until then and after. */
  .material-icons:not([data-i]), .msr:not([data-i]) { color: transparent; }

  .skip-link {
    position: fixed; left: 12px; top: -60px; z-index: 2000;
    padding: 10px 14px; border-radius: var(--r-sm); background: var(--acc); color: var(--acc-ink); font-weight: 600;
    transition: top var(--t);
  }
  .skip-link:focus { top: 12px; }
  .sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* ---------------------------------------------------------------- layout -- */
@layer layout {
  .wrap, .container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
  .page { padding-block: 28px 64px; }
  .stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
  .row { display: flex; align-items: center; gap: var(--gap, 10px); flex-wrap: wrap; }
  .grow { flex: 1 1 auto; min-width: 0; }
  .grid { display: grid; gap: var(--gap, 16px); grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
  .grid-auto { display: grid; gap: var(--gap, 14px); grid-template-columns: repeat(auto-fill, minmax(var(--min, 220px), 1fr)); }
  .split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) var(--side, 360px); align-items: start; }
  .split.is-left { grid-template-columns: var(--side, 340px) minmax(0, 1fr); }
  .sticky-side { position: sticky; top: calc(var(--hdr-h) + var(--tick-h) + 16px); }
  @media (max-width: 1100px) {
    .split, .split.is-left { grid-template-columns: minmax(0, 1fr); }
    .sticky-side { position: static; }
  }
  @media (max-width: 900px) { .grid { grid-template-columns: repeat(min(var(--cols, 3), 2), minmax(0, 1fr)); } }
  @media (max-width: 560px) { .grid { grid-template-columns: minmax(0, 1fr); } .grid.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
}

/* ------------------------------------------------------------ components -- */
@layer components {

  /* ======== header =================================================== */
  .site-header { position: sticky; top: 0; z-index: var(--z-hdr); }
  .hdr {
    position: relative;
    background: var(--glass);
    -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid var(--line);
  }
  .hdr-bar { height: var(--hdr-h); display: flex; align-items: center; gap: 18px; }
  .brand { display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--ink); }
  .brand img { width: 34px; height: 34px; }
  .brand-type { display: flex; flex-direction: column; line-height: 1; }
  .brand-type b { font: 800 15px/1 var(--f-display); font-stretch: 118%; letter-spacing: .02em; text-transform: uppercase; }
  .brand-type small { font: 600 9.5px/1 var(--f-mono); letter-spacing: .32em; color: var(--ink-3); margin-top: 4px; text-transform: uppercase; }

  .hdr-nav { display: flex; align-items: center; gap: 2px; min-width: 0; }
  .hdr-link {
    position: relative; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px;
    border-radius: var(--r-sm); color: var(--ink-2); font-weight: 520; font-size: 13.5px; white-space: nowrap;
    transition: color var(--t-fast), background var(--t-fast);
  }
  .hdr-link .i { font-size: 17px; color: var(--ink-3); transition: color var(--t-fast); }
  .hdr-link:hover { color: var(--ink); background: var(--s2); }
  .hdr-link:hover .i { color: var(--ink-2); }
  .hdr-link.is-active { color: var(--ink); }
  .hdr-link.is-active .i { color: var(--acc); }
  .hdr-link.is-active::after {
    content: ''; position: absolute; left: 11px; right: 11px; bottom: calc((var(--hdr-h) - 36px) / -2); height: 2px;
    background: var(--acc); border-radius: 2px 2px 0 0; box-shadow: 0 0 14px rgb(var(--acc-rgb) / .8);
  }
  .hdr-link .caret { font-size: 14px; transition: transform var(--t); }
  .hdr-more.is-open .caret { transform: rotate(180deg); }

  .hdr-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
  .cmdk-btn {
    display: inline-flex; align-items: center; gap: 10px; height: 38px; width: 200px; padding: 0 8px 0 12px;
    border-radius: var(--r); background: var(--s1); border: 1px solid var(--line-2); color: var(--ink-3);
    font-size: 13.5px; transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
  }
  .cmdk-btn .i { font-size: 17px; }
  .cmdk-btn:hover { border-color: var(--line-3); color: var(--ink-2); background: var(--s2); }
  .cmdk-btn span { flex: 1; text-align: left; }
  .kbd {
    display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 6px; border-radius: 5px;
    font: 600 11px/1 var(--f-mono); color: var(--ink-3); background: var(--s3); border: 1px solid var(--line-2); border-bottom-width: 2px;
  }
  .icon-btn {
    width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: var(--r);
    color: var(--ink-2); background: var(--s1); border: 1px solid var(--line-2);
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  }
  .icon-btn .i { font-size: 19px; }
  .icon-btn:hover { background: var(--s2); color: var(--ink); border-color: var(--line-3); }
  .hdr-burger { display: none; }

  /* mega menu */
  .hdr-more { position: relative; }
  .mega {
    position: absolute; top: calc(100% + 12px); left: var(--left, 0px);
    width: min(calc(var(--cols, 4) * 256px + 20px), calc(100vw - 32px)); padding: 10px; border-radius: var(--r-lg);
    background: var(--s2); box-shadow: var(--shadow-pop);
    display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 6px;
    /* Opacity and a clip from the top only: no scale, so the entries never shift
       or re-rasterize while the panel opens. */
    opacity: 0; visibility: hidden; clip-path: inset(0 0 100% 0 round var(--r-lg));
    transition: opacity .14s ease, clip-path .2s var(--ease-out), visibility 0s .2s;
  }
  .mega::before { content: ''; position: absolute; inset: -14px 0 auto; height: 14px; }
  .hdr-more.is-open .mega { opacity: 1; visibility: visible; clip-path: inset(-40px -40px -60px -40px round var(--r-lg)); transition: opacity .14s ease, clip-path .24s var(--ease-out), visibility 0s; }
  .mega-col { display: flex; flex-direction: column; gap: 6px; }
  .mega-group { padding: 8px; border-radius: var(--r); }
  .mega-label { font: 700 10.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); padding: 4px 8px 10px; }
  .mega-item {
    display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm);
    color: var(--ink-2); font-weight: 520; font-size: 13.5px; transition: background var(--t-fast), color var(--t-fast);
  }
  .mega-item .i { font-size: 18px; color: var(--ink-3); width: 30px; height: 30px; padding: 6px; border-radius: 8px; background: var(--s3); transition: color var(--t-fast), background var(--t-fast); }
  .mega-item:hover { background: var(--s3); color: var(--ink); }
  .mega-item:hover .i { color: var(--acc); background: rgb(var(--acc-rgb) / .14); }
  .tag-new, .tag-pro {
    margin-left: auto; font: 700 9.5px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase;
    padding: 4px 6px; border-radius: 4px; background: rgb(var(--acc-rgb) / .16); color: var(--acc-hi);
  }
  .tag-pro { background: color-mix(in srgb, var(--hi) 16%, transparent); color: var(--hi); }

  /* ======== account (Arenyze SSO) =================================== */
  .hdr-account { display: flex; align-items: center; gap: 8px; }
  .hdr-account:empty { display: none; }
  .acct-w { position: relative; }
  .acct-bell { position: relative; }
  .acct-badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--acc); color: #fff; font: 700 10px/17px var(--f-mono); font-style: normal; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
  .acct-av { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 4px; border-radius: var(--r); background: var(--s1); border: 1px solid var(--line-2); transition: background var(--t-fast); }
  .acct-av:hover, .acct-av[aria-expanded="true"] { background: var(--s2); }
  .acct-av img, .acct-av > span { width: 28px; height: 28px; border-radius: 7px; object-fit: cover; display: grid; place-items: center; background: var(--s4); font: 800 13px/1 var(--f-display); }
  .acct-av b { font-size: 13px; font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .acct-av .i { font-size: 14px; color: var(--ink-3); }
  .acct-pop { position: absolute; z-index: var(--z-pop); top: calc(100% + 10px); right: 0; width: 240px; max-width: calc(100vw - 24px); padding: 5px; border-radius: var(--r-lg); background: var(--s2); box-shadow: var(--shadow-pop); animation: pop-in .18s var(--ease-out); }
  .acct-pop hr { margin: 5px 0; }
  .acct-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 520; font-size: 13.5px; text-align: left; }
  .acct-item:hover { background: var(--s3); color: var(--ink); }
  .acct-item .i { font-size: 17px; color: var(--ink-3); }
  .acct-item.is-danger:hover, .acct-item.is-danger:hover .i { color: var(--down); }
  .acct-bellpop { width: 360px; padding: 0; overflow: hidden; }
  .acct-pophead { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .acct-pophead b { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; }
  .acct-pophead button { color: var(--ink-3); font-size: 12px; font-weight: 600; }
  .acct-pophead button:hover { color: var(--ink); }
  .acct-list { max-height: 360px; overflow-y: auto; }
  .acct-noti { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .acct-noti-ic { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--s3); color: var(--ink-2); }
  .acct-noti b { font-size: 13px; display: block; }
  .acct-noti p { color: var(--ink-2); font-size: 12.5px; margin: 2px 0 4px; }
  .acct-noti small { color: var(--ink-4); }
  .acct-noti.is-unread b::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--acc); vertical-align: middle; }
  .acct-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 16px; color: var(--ink-3); font-size: 13px; text-align: center; }
  .acct-empty .i { font-size: 26px; }
  .acct-foot { display: block; padding: 10px; text-align: center; color: var(--ink-3); font-size: 12px; font-weight: 600; border-top: 1px solid var(--line); }
  .acct-foot:hover { color: var(--ink); }
  @media (max-width: 720px) { .acct-av b, .acct-av .i { display: none; } .acct-av { padding: 0 4px; } .acct-signin span { display: none; } .acct-bell { display: none; } }

  /* ======== mobile drawer + bottom tab bar ========================== */
  .drawer-back { position: fixed; inset: 0; z-index: calc(var(--z-modal) - 1); background: #000a; opacity: 0; visibility: hidden; transition: opacity var(--t), visibility 0s var(--t); }
  .drawer-back.is-open { opacity: 1; visibility: visible; transition: opacity var(--t); }
  .drawer {
    position: fixed; z-index: var(--z-modal); inset: 0 0 0 auto; width: min(380px, 92vw);
    display: flex; flex-direction: column; background: var(--s1); box-shadow: var(--shadow-pop);
    transform: translateX(104%); transition: transform .34s var(--ease-out); visibility: hidden;
  }
  .drawer.is-open { transform: none; visibility: visible; }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; height: var(--hdr-h); padding: 0 16px; border-bottom: 1px solid var(--line); flex: none; }
  .drawer-body { overflow-y: auto; padding: 10px 10px 30px; overscroll-behavior: contain; }
  .drawer-label { font: 700 10.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); padding: 18px 10px 8px; }
  .drawer-link { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 520; }
  .drawer-link .i { font-size: 19px; color: var(--ink-3); }
  .drawer-link:hover, .drawer-link.is-active { background: var(--s3); color: var(--ink); }
  .drawer-link.is-active .i { color: var(--acc); }

  .tabbar {
    display: none; position: fixed; z-index: var(--z-hdr); left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
    border-top: 1px solid var(--line-2);
    grid-template-columns: repeat(5, 1fr);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: var(--r);
    font: 600 10.5px/1 var(--f-ui); color: var(--ink-3); transition: color var(--t-fast);
  }
  .tabbar .i { font-size: 22px; }
  .tabbar .is-active { color: var(--ink); }
  .tabbar .is-active .i { color: var(--acc); filter: drop-shadow(0 0 8px rgb(var(--acc-rgb) / .7)); }
  .tabbar .tb-search .i {
    width: 44px; height: 44px; padding: 11px; border-radius: 14px; margin-top: -18px;
    background: var(--acc); color: var(--acc-ink); box-shadow: 0 10px 26px -6px rgb(var(--acc-rgb) / .7), 0 0 0 4px var(--bg);
  }

  /* Desktop links are words only; the icons belong to the drawer and menus. */
  .hdr-link > .i:not(.caret) { display: none; }
  .hdr-bar { gap: 14px; }
  .hdr-nav { flex: 1 1 auto; min-width: 0; }
  .mega-item.more-opt { display: none; }
  @media (max-width: 1240px) { .hdr-link:has(.lbl-opt) { display: none; } .mega-item.more-opt { display: flex; } .cmdk-btn { width: 170px; } }
  @media (max-width: 1100px) {
    .hdr-nav { display: none; }
    .hdr-burger { display: inline-grid; }
    .cmdk-btn { width: auto; flex: 1; max-width: 360px; }
    .hdr-tools { flex: 1; justify-content: flex-end; }
  }
  @media (max-width: 860px) {
    .tabbar { display: grid; }
    .hdr-app { display: none; }
    .cmdk-btn .kbd { display: none; }
  }
  @media (max-width: 520px) { .brand-type { display: none; } .cmdk-btn span { font-size: 13px; } }

  /* ======== footer ================================================== */
  .site-footer { position: relative; margin-top: 40px; border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--bg-2), var(--bg)); overflow: hidden; }
  .foot-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px; padding-block: 48px 36px; }
  .foot-brand p { color: var(--ink-3); font-size: 13px; margin: 14px 0 18px; max-width: 360px; }
  .foot-col h4 { font: 700 10.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 14px; }
  .foot-col a { display: block; color: var(--ink-3); font-size: 13.5px; padding: 4px 0; transition: color var(--t-fast), transform var(--t-fast); }
  .foot-col a:hover { color: var(--ink); transform: translateX(3px); }
  .foot-social { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
  .foot-social a:first-child { flex: 0 1 auto; min-width: 0; white-space: nowrap; }
  .foot-social a { height: 36px; min-width: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--r-sm); background: var(--s2); border: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px; transition: background var(--t-fast), color var(--t-fast); }
  .foot-social a:hover { background: var(--s3); color: var(--ink); }
  .foot-social svg { width: 16px; height: 16px; }
  .foot-bar { border-top: 1px solid var(--line); padding-block: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; color: var(--ink-4); font-size: 12px; }
  @media (max-width: 960px) { .foot-grid { grid-template-columns: repeat(2, 1fr); } .foot-brand { grid-column: 1 / -1; } }

  /* ======== page head =============================================== */
  .phead { position: relative; padding-block: 34px 22px; }
  .crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 500 12px/1 var(--f-mono); color: var(--ink-4); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .06em; }
  .crumbs a { color: var(--ink-3); }
  .crumbs a:hover { color: var(--ink); }
  .crumbs .i { font-size: 12px; }
  .phead-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; }
  .phead-title { font: 850 clamp(30px, 4.4vw, 52px)/.95 var(--f-display); font-stretch: var(--display-stretch); letter-spacing: -.01em; text-transform: uppercase; }
  .phead-title em { font-style: normal; color: var(--acc); }
  .phead-sub { color: var(--ink-2); font-size: 15px; margin-top: 12px; max-width: 720px; }
  .phead-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 700 11px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--acc-hi); margin-bottom: 12px; }
  .eyebrow::before { content: ''; width: 18px; height: 2px; background: currentColor; }

  /* section title: the broadcast lower-third */
  .lt { display: flex; align-items: center; gap: 12px; margin: 30px 0 14px; }
  .lt:first-child { margin-top: 0; }
  .lt-title { position: relative; font: 800 15px/1 var(--f-display); font-stretch: 116%; letter-spacing: .04em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 10px; }
  .lt-title::before { content: ''; width: 4px; height: 18px; background: var(--acc); border-radius: 1px; box-shadow: 0 0 12px rgb(var(--acc-rgb) / .7); }
  .lt-title small { font: 500 11px/1 var(--f-mono); letter-spacing: .06em; color: var(--ink-4); text-transform: uppercase; }
  .lt-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
  .lt-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 560; color: var(--ink-3); transition: color var(--t-fast), gap var(--t-fast); white-space: nowrap; }
  .lt-link:hover { color: var(--acc-hi); gap: 7px; }
  .lt-link .i { font-size: 14px; }

  /* ======== panel (card) =========================================== */
  .panel {
    position: relative; background: var(--s1); border-radius: var(--r-lg);
    box-shadow: var(--edge), 0 0 0 1px var(--line);
    clip-path: var(--panel-shape, none);
  }
  .panel.is-flat { background: transparent; box-shadow: 0 0 0 1px var(--line); }
  .panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .panel-h h2, .panel-h h3 { font: 700 13px/1.2 var(--f-display); font-stretch: 112%; letter-spacing: .06em; text-transform: uppercase; display: flex; align-items: center; gap: 9px; }
  .panel-h h2 .i, .panel-h h3 .i { font-size: 17px; color: var(--acc); }
  .panel-h .meta { font: 500 11.5px/1 var(--f-mono); color: var(--ink-4); }
  .panel-b { padding: 16px; }
  .panel-f { padding: 12px 16px; border-top: 1px solid var(--line); }
  .panel.is-glow:hover { box-shadow: var(--edge), 0 0 0 1px var(--line-2); }

  /* cursor spotlight (app.js sets --mx/--my on [data-spot]) */
  [data-spot] { --mx: 50%; --my: 50%; }
  [data-spot]::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
    background: radial-gradient(420px circle at var(--mx) var(--my), rgb(var(--acc-rgb) / .09), transparent 60%);
    opacity: 0; transition: opacity var(--t);
  }
  [data-spot]:hover::before { opacity: 1; }
  [data-spot] > * { position: relative; z-index: 1; }

  /* ======== buttons ================================================= */
  .btn {
    --b-bg: var(--s3); --b-fg: var(--ink); --b-bd: var(--line-2);
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px; border-radius: var(--r); white-space: nowrap;
    background: var(--b-bg); color: var(--b-fg); box-shadow: inset 0 0 0 1px var(--b-bd), var(--edge);
    font-weight: 600; font-size: 13.5px; letter-spacing: .005em;
    transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast), color var(--t-fast);
  }
  .btn .i { font-size: 17px; }
  .btn:hover { --b-bg: var(--s4); color: var(--b-fg); }
  .btn:active { transform: translateY(1px) scale(.99); }
  .btn:disabled, .btn.is-disabled { opacity: .45; pointer-events: none; }
  .btn-primary { --b-bg: var(--acc); --b-fg: var(--acc-ink); --b-bd: transparent; box-shadow: 0 8px 24px -10px rgb(var(--acc-rgb) / .9), inset 0 1px 0 #ffffff33; }
  .btn-primary:hover { --b-bg: var(--acc-hi); }
  .btn-hi { --b-bg: var(--hi); --b-fg: var(--hi-ink); --b-bd: transparent; }
  .btn-hi:hover { --b-bg: color-mix(in srgb, var(--hi) 85%, #fff); }
  .btn-ghost { --b-bg: transparent; --b-bd: var(--line-2); }
  .btn-ghost:hover { --b-bg: var(--s2); }
  .btn-quiet { --b-bg: transparent; --b-bd: transparent; color: var(--ink-2); }
  .btn-quiet:hover { --b-bg: var(--s2); }
  .btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-sm); gap: 6px; }
  .btn-sm .i { font-size: 15px; }
  .btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
  .btn-icon { width: 40px; padding: 0; }
  .btn-sm.btn-icon { width: 32px; }
  .btn.is-on { --b-bg: rgb(var(--acc-rgb) / .16); --b-bd: rgb(var(--acc-rgb) / .5); color: var(--acc-hi); }

  /* ======== chips & tags ============================================ */
  .chip {
    display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 999px;
    background: var(--s3); color: var(--ink-2); font-size: 12px; font-weight: 560; white-space: nowrap;
    box-shadow: inset 0 0 0 1px var(--line);
  }
  .chip .i { font-size: 14px; }
  a.chip:hover, button.chip:hover { background: var(--s4); color: var(--ink); }
  .chip.is-acc { background: rgb(var(--acc-rgb) / .14); color: var(--acc-hi); box-shadow: inset 0 0 0 1px rgb(var(--acc-rgb) / .3); }
  .chip.is-up { background: color-mix(in srgb, var(--up) 13%, transparent); color: var(--up); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--up) 28%, transparent); }
  .chip.is-down { background: color-mix(in srgb, var(--down) 13%, transparent); color: var(--down); }
  .chip.is-hi { background: color-mix(in srgb, var(--hi) 14%, transparent); color: var(--hi); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hi) 30%, transparent); }
  .chip.is-sm { height: 21px; padding: 0 7px; font-size: 11px; }
  .club {
    display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px;
    font: 700 11px/1 var(--f-mono); letter-spacing: .02em; color: var(--ink-2);
    background: var(--s3); box-shadow: inset 0 0 0 1px var(--line-2); white-space: nowrap; vertical-align: middle;
    transition: background var(--t-fast), color var(--t-fast);
  }
  a.club:hover { background: rgb(var(--acc-rgb) / .16); color: var(--acc-hi); }
  .live {
    display: inline-flex; align-items: center; gap: 5px; height: 18px; padding: 0 6px; border-radius: 4px; vertical-align: middle;
    font: 700 9.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--down);
    background: color-mix(in srgb, var(--down) 14%, transparent);
  }
  .live::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: pulse-dot 1.4s ease-in-out infinite; }

  /* ======== stat tiles ============================================== */
  .kpis { display: grid; gap: 10px; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); }
  @media (max-width: 980px) { .kpis { grid-template-columns: repeat(min(var(--n, 4), 2), minmax(0, 1fr)); } }
  .kpi {
    position: relative; overflow: hidden; padding: 14px 16px 15px; border-radius: var(--r);
    background: var(--s1); box-shadow: var(--edge), 0 0 0 1px var(--line);
  }
  .kpi-l { display: flex; align-items: center; gap: 7px; font: 600 11px/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
  .kpi-l .i { font-size: 14px; color: var(--acc); }
  .kpi-v { display: flex; align-items: center; gap: 8px; margin-top: 10px; font: 800 30px/1 var(--f-display); font-stretch: var(--num-stretch); font-variant-numeric: tabular-nums; letter-spacing: -.005em; white-space: nowrap; }
  .kpi-v small { font: 600 12px/1 var(--f-mono); color: var(--ink-3); letter-spacing: 0; }
  .kpi-v img { width: 30px; height: 30px; }
  .kpi-s { margin-top: 7px; font-size: 12.5px; color: var(--ink-3); }
  .kpi-s b { color: var(--ink-2); }
  .kpi.is-acc { background: linear-gradient(160deg, rgb(var(--acc-rgb) / .2), var(--s1) 65%); box-shadow: var(--edge), 0 0 0 1px rgb(var(--acc-rgb) / .3); }
  .kpi.is-acc .kpi-v { color: #fff; }

  /* rolling digits (TF.roll): each digit is a column that slides to its value */
  .roll { display: inline-flex; align-items: flex-start; overflow: hidden; height: 1em; line-height: 1; vertical-align: top; }
  .roll-d { display: inline-flex; flex-direction: column; transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--k, 0) * 55ms); }
  .roll-d > span { height: 1em; display: block; flex: none; }
  .roll-s { display: inline-block; }

  /* ======== tables ================================================== */
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .tbl-wrap.is-loading { opacity: .55; pointer-events: none; transition: opacity var(--t); }
  .tbl { width: 100%; font-size: 13.5px; }
  .tbl th {
    position: sticky; top: 0; z-index: 1; height: 38px; padding: 0 12px; text-align: left; white-space: nowrap;
    font: 650 10.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4);
    background: var(--s1); border-bottom: 1px solid var(--line-2);
  }
  .tbl td { height: 52px; padding: 6px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
  .tbl tbody tr { position: relative; transition: background var(--t-fast); }
  .tbl tbody tr:last-child td { border-bottom: 0; }
  .tbl tbody tr[data-href] { cursor: pointer; }
  .tbl tbody tr:hover { background: var(--s2); }
  .tbl tbody tr[data-href]:hover td:first-child { box-shadow: inset 3px 0 0 var(--acc); }
  .tbl .num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
  .tbl .c { text-align: center; }
  .tbl .strong { font-weight: 650; color: var(--ink); }
  .tbl .dim { color: var(--ink-3); }
  .tbl .score { font: 700 15px/1 var(--f-display); font-stretch: var(--num-stretch); letter-spacing: .01em; }
  .tbl tr.is-me { background: rgb(var(--acc-rgb) / .08); }
  .tbl tr.is-me td:first-child { box-shadow: inset 3px 0 0 var(--acc); }
  .tbl.is-compact td { height: 42px; }
  @media (max-width: 720px) { .hide-sm { display: none; } .tbl td, .tbl th { padding-inline: 8px; } }
  @media (max-width: 1000px) { .hide-md { display: none; } }

  /* rank cell: the podium gets its metal */
  .pos { display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 6px; border-radius: 6px; font: 800 14px/1 var(--f-display); font-stretch: var(--num-stretch); color: var(--ink-2); font-variant-numeric: tabular-nums; }
  .pos.p1, .pos.p2, .pos.p3, .pos.is-1, .pos.is-2, .pos.is-3 { color: #111; }
  .pos.p1, .pos.is-1 { background: linear-gradient(160deg, #fff1a6, var(--gold) 55%, #c99a18); box-shadow: 0 0 18px -4px var(--gold); }
  .pos.p2, .pos.is-2 { background: linear-gradient(160deg, #ffffff, var(--silver) 60%, #8a95a3); }
  .pos.p3, .pos.is-3 { background: linear-gradient(160deg, #ffc69c, var(--bronze) 60%, #91552c); }

  /* player cell */
  .pc { display: flex; align-items: center; gap: 11px; min-width: 0; }
  .pc-av { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--s3); font: 800 14px/1 var(--f-display); color: var(--ink-2); }
  .pc-av img { width: 30px; height: 30px; }
  .pc-av.is-icon { background: transparent; }
  .pc-main { display: flex; flex-direction: column; min-width: 0; }
  .pc-name { font-weight: 620; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  a.pc-name:hover, .pc a:hover .pn-name { color: var(--acc-hi); }
  .pc-sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pn-tag { color: var(--ink-4); font-weight: 500; margin-left: 1px; font-size: .92em; }

  .lg { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--ink-2); }
  .lg img { width: 24px; height: 24px; }
  .rank-ic { flex: none; }

  .delta { display: inline-flex; align-items: center; gap: 1px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .delta.up { color: var(--up); }
  .delta.down { color: var(--down); }
  .delta.flat { color: var(--ink-4); }
  .delta .i { font-size: 12px; }

  /* ======== ranked list rows ======================================== */
  .rows { display: flex; flex-direction: column; }
  .rw {
    position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 56px;
    border-bottom: 1px solid var(--line); transition: background var(--t-fast);
  }
  .rw:last-child { border-bottom: 0; }
  .rw[data-href] { cursor: pointer; }
  .rw[data-href]:hover, a.rw:hover { background: var(--s2); }
  .rw-n { width: 22px; flex: none; text-align: center; font: 800 14px/1 var(--f-display); font-stretch: var(--num-stretch); color: var(--ink-4); }
  .rw-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .rw-t { font-weight: 620; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rw-s { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rw-end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; text-align: right; }
  .rw-v { font: 800 16px/1 var(--f-display); font-stretch: var(--num-stretch); font-variant-numeric: tabular-nums; }
  .bar { width: 72px; height: 4px; border-radius: 2px; background: var(--s4); overflow: hidden; }
  .bar > i { display: block; height: 100%; border-radius: inherit; background: var(--bar, var(--acc)); transform-origin: left; animation: none; }
  @keyframes grow-x { from { transform: scaleX(0); } }

  /* ======== tabs & segmented ======================================== */
  .tabs { position: relative; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    position: relative; flex: none; display: inline-flex; align-items: center; gap: 7px; height: 46px; padding: 0 14px;
    color: var(--ink-3); font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: color var(--t-fast);
  }
  .tab:hover { color: var(--ink); }
  .tab.is-on { color: var(--ink); }
  .tab .count { font: 600 11px/1 var(--f-mono); padding: 3px 6px; border-radius: 4px; background: var(--s3); color: var(--ink-3); }
  .tabs-ink { position: absolute; left: 0; bottom: 0; height: 2px; width: var(--w, 0); transform: translateX(var(--x, 0)); background: var(--acc); box-shadow: 0 0 14px rgb(var(--acc-rgb) / .8); border-radius: 2px 2px 0 0; transition: transform .35s var(--ease-out), width .35s var(--ease-out); }

  .seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r); background: var(--s1); box-shadow: inset 0 0 0 1px var(--line-2); }
  .seg > button, .seg > a {
    display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 7px;
    font-weight: 600; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; transition: background var(--t-fast), color var(--t-fast);
  }
  .seg > :hover { color: var(--ink); }
  .seg > .is-on, .seg > [aria-pressed="true"], .seg > [aria-selected="true"] { background: var(--s4); color: var(--ink); box-shadow: var(--edge), 0 1px 3px #0006; }
  .seg small { font: 600 10.5px/1 var(--f-mono); color: var(--ink-4); }
  .seg .i { font-size: 15px; }

  /* ======== forms =================================================== */
  .field { position: relative; display: flex; align-items: center; }
  .input, .field input, .field textarea {
    width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r);
    background: var(--s1); border: 1px solid var(--line-2); color: var(--ink); outline: none;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  }
  textarea.input, .field textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
  .input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--ink-4); }
  .input:hover, .field input:hover { border-color: var(--line-3); }
  .input:focus, .field input:focus, .field textarea:focus { border-color: rgb(var(--acc-rgb) / .7); box-shadow: 0 0 0 4px rgb(var(--acc-rgb) / .14); background: var(--s2); }
  .field > .i { position: absolute; left: 12px; font-size: 17px; color: var(--ink-3); pointer-events: none; }
  .field > .i ~ input { padding-left: 38px; }
  .field .kbd { position: absolute; right: 9px; }
  .label { display: block; font: 600 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
  input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
  input[type="checkbox"], input[type="radio"] { accent-color: var(--acc); }

  /* select skin (app.js wraps every <select>) */
  .sel { position: relative; display: inline-flex; min-width: 0; }
  .sel > select { position: absolute; inset: 0; opacity: 0; pointer-events: none; width: 100%; }
  .sel-btn {
    display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; height: 38px; padding: 0 10px 0 12px;
    border-radius: var(--r); background: var(--s1); border: 1px solid var(--line-2); color: var(--ink); font-weight: 560; font-size: 13.5px; text-align: left;
    transition: border-color var(--t-fast), background var(--t-fast);
  }
  .sel-btn:hover { border-color: var(--line-3); background: var(--s2); }
  .sel.is-open .sel-btn { border-color: var(--line-3); background: var(--s2); box-shadow: none; }
  .sel-btn:focus { outline: none; }
  .sel-btn:focus-visible { outline: none; border-color: var(--line-3); }
  .sel-val { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sel-caret { font-size: 13px; color: var(--ink-3); transition: transform .3s var(--spring), color var(--t-fast); }
  .sel-btn:hover .sel-caret { color: var(--ink); }
  .sel.is-open .sel-caret { transform: rotate(-180deg); color: var(--acc); }
  .sel.is-disabled { opacity: .5; }
  .sel-menu, .pop {
    position: absolute; z-index: var(--z-pop); top: calc(100% + 6px); left: 0; min-width: 100%; max-height: 320px; overflow-y: auto;
    padding: 5px; border-radius: var(--r); background: var(--s2); box-shadow: var(--shadow-pop); overscroll-behavior: contain;
  }
  .tf-floating { position: fixed; inset: auto; margin: 0; border: 0; color: var(--ink); }
  @keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
  .sel-menu.fx-open, .pop.fx-open { animation: drop-in .18s var(--ease-out); }
  .sel-menu.fx-open.is-up, .pop.fx-open.is-up { animation-name: drop-up; }
  @keyframes drop-in { from { opacity: 0; clip-path: inset(0 0 100% 0 round 10px); } to { opacity: 1; clip-path: inset(0 0 0 0 round 10px); } }
  @keyframes drop-up { from { opacity: 0; clip-path: inset(100% 0 0 0 round 10px); } to { opacity: 1; clip-path: inset(0 0 0 0 round 10px); } }
  .sel-opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 10px; border-radius: 7px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
  .sel-opt.is-active { background: var(--s4); color: var(--ink); }
  .sel-opt.is-sel { color: var(--ink); font-weight: 600; }
  .sel-opt.is-off { opacity: .4; pointer-events: none; }
  .sel-tick { font-size: 14px; color: var(--acc); visibility: hidden; }
  .sel-opt.is-sel .sel-tick { visibility: visible; }

  /* switch */
  .switch { position: relative; width: 38px; height: 22px; flex: none; }
  .switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }
  .switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--s4); transition: background var(--t); }
  .switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--t) var(--spring); }
  .switch input:checked + i { background: var(--acc); }
  .switch input:checked + i::after { transform: translateX(16px); }

  /* ======== pager =================================================== */
  .pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
  .pager-info { font: 500 12px/1 var(--f-mono); color: var(--ink-3); }
  .pager-btns { display: flex; gap: 4px; align-items: center; }
  .pager-btns button, .pager-btns a { min-width: 34px; height: 34px; padding: 0 8px; border-radius: var(--r-sm); display: inline-grid; place-items: center; font: 600 13px/1 var(--f-mono); color: var(--ink-2); background: var(--s2); box-shadow: inset 0 0 0 1px var(--line); transition: background var(--t-fast), color var(--t-fast); }
  .pager-btns button:hover:not(:disabled), .pager-btns a:hover { background: var(--s3); color: var(--ink); }
  .pager-btns button:disabled { opacity: .35; cursor: default; }
  .pager-btns .is-on { background: var(--acc); color: var(--acc-ink); box-shadow: none; }

  /* ======== skeleton, empty, spinner ================================ */
  /* skeletons: a soft panel with a light sweep tinted in the site colour */
  .sk {
    position: relative; overflow: hidden; border-radius: 8px;
    background: linear-gradient(100deg, var(--s2) 30%, color-mix(in srgb, var(--s3) 70%, rgb(var(--acc-rgb) / .25)) 50%, var(--s2) 70%) 0 0 / 300% 100%;
    animation: sk-sweep 1.6s var(--ease-io) infinite;
  }
  .sk-line { height: 12px; margin: 12px 0; border-radius: 6px; }
  .sk-line:nth-child(3n+2) { width: 82%; }
  .sk-line:nth-child(3n) { width: 64%; }
  .sk-block { height: 180px; border-radius: 12px; }
  @keyframes sk-sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }
  /* a block that just swapped its skeleton for data fades in once */
  .fx-in { animation: none; }
  @keyframes fx-in { from { opacity: 0; } }

  .empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 20px; color: var(--ink-3); }
  .empty > .i, .empty > .ico { font-size: 40px; width: 64px; height: 64px; padding: 14px; border-radius: 18px; background: var(--s2); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line); }
  .empty h3 { font: 800 18px/1.2 var(--f-display); font-stretch: 110%; text-transform: uppercase; color: var(--ink); letter-spacing: .02em; }
  .empty p { max-width: 440px; font-size: 13.5px; }
  .empty .btn { margin-top: 8px; }

  .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-3); border-top-color: var(--acc); animation: spin .7s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ======== meter =================================================== */
  .meter { height: 8px; border-radius: 4px; background: var(--s4); overflow: hidden; }
  .meter > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--m, var(--acc)) 60%, transparent), var(--m, var(--acc))); box-shadow: 0 0 14px var(--m, var(--acc)); transform-origin: left; animation: none; }

  /* ======== emblem (rank icon with tier glow) ======================= */
  .emblem { position: relative; display: inline-grid; place-items: center; flex: none; }
  .emblem::before { content: ''; position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--tier, var(--acc)) 55%, transparent), transparent); filter: blur(10px); opacity: .7; }
  .emblem img { position: relative; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 10px #0009); }
  .emblem-none { border-radius: 30%; background: var(--s3); color: var(--ink-4); }
  .emblem-none::before { display: none; }
  .emblem-none .i { width: 46%; height: 46%; }

  /* ======== tooltip ================================================= */
  [data-tip] { position: relative; }
  .tf-info-tooltip {
    padding: 8px 11px; border: 1px solid var(--line-3); border-radius: 8px;
    background: var(--s4); color: var(--ink); box-shadow: var(--shadow-2);
    font: 500 12px/1.5 var(--f-ui); text-transform: none; letter-spacing: 0; text-align: left;
  }
  .tf-tooltip-float.tf-tooltip-float {
    position: fixed; inset: auto; margin: 0; z-index: 10000; width: max-content;
    min-width: 0; white-space: normal; overflow-wrap: anywhere; overflow: auto;
    transform: none; pointer-events: none;
  }
  .tip-dot { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: var(--ink-4); }
  .tip-dot:hover { color: var(--ink-2); }
  .tip-dot .i { font-size: 13px; }

  /* ======== modal / sheet =========================================== */
  .modal { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: 20px; }
  .modal-back { position: absolute; inset: 0; background: #000b; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade-in .2s ease both; }
  .modal-panel {
    position: relative; width: min(640px, 100%); max-height: min(86vh, 900px); display: flex; flex-direction: column;
    border-radius: var(--r-xl); background: var(--s1); box-shadow: var(--shadow-pop); overflow: hidden;
    animation: modal-in .32s var(--ease-out) both;
  }
  .modal.is-wide .modal-panel { width: min(1180px, 100%); }
  .modal.is-compact .modal-panel { width: min(520px, 100%); }
  .modal-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex: none; }
  .modal-h h3 { font: 800 18px/1.15 var(--f-display); font-stretch: 112%; text-transform: uppercase; letter-spacing: .02em; }
  .modal-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
  .modal-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .modal-b { padding: 18px; overflow-y: auto; overscroll-behavior: contain; }
  html:has(> body.modal-open) { overflow: hidden; }
  .modal.is-drawer { place-items: stretch end; padding: 0; }
  .modal.is-drawer .modal-panel { width: min(560px, 100%); max-height: none; height: 100%; border-radius: 0; animation: drawer-in .38s var(--ease-out) both; }
  @keyframes fade-in { from { opacity: 0; } }
  @keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
  @keyframes drawer-in { from { transform: translateX(100%); } }
  @keyframes sheet-in { from { transform: translateY(100%); } }
  @media (max-width: 720px) {
    .modal, .modal.is-drawer { place-items: end stretch; padding: 0; }
    .modal-panel, .modal.is-drawer .modal-panel { width: 100%; height: auto; max-height: 92vh; border-radius: 22px 22px 0 0; animation: sheet-in .38s var(--ease-out) both; }
    .modal-panel::before { content: ''; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--s5); }
    .modal-h { padding-top: 20px; }
  }

  /* ======== command palette ========================================= */
  .cmdk { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
  .cmdk-back { position: absolute; inset: 0; background: #000b; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: fade-in .18s ease both; }
  .cmdk-box {
    position: relative; width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column;
    border-radius: var(--r-xl); background: var(--s1); box-shadow: var(--shadow-pop), 0 0 0 1px rgb(var(--acc-rgb) / .25), 0 0 80px -20px rgb(var(--acc-rgb) / .5);
    overflow: hidden; animation: modal-in .26s var(--ease-out) both;
  }
  .cmdk-in { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 60px; border-bottom: 1px solid var(--line); flex: none; }
  .cmdk-in .i { font-size: 21px; color: var(--acc); }
  .cmdk-in input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; font-size: 17px; color: var(--ink); }
  .cmdk-in input::placeholder { color: var(--ink-4); }
  .cmdk-list { overflow-y: auto; padding: 8px; overscroll-behavior: contain; }
  .cmdk-group { font: 700 10.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); padding: 12px 10px 8px; }
  .cmdk-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r); cursor: pointer; color: var(--ink-2); }
  .cmdk-item.is-active { background: var(--s3); color: var(--ink); }
  .cmdk-item.is-active .cmdk-go { opacity: 1; transform: none; }
  .cmdk-ic { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--s3); color: var(--ink-3); font: 800 14px/1 var(--f-display); }
  .cmdk-ic .i { font-size: 18px; }
  .cmdk-ic img { width: 28px; height: 28px; }
  .cmdk-item.is-active .cmdk-ic { background: rgb(var(--acc-rgb) / .16); color: var(--acc-hi); }
  .cmdk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .cmdk-main b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cmdk-main small { color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cmdk-end { font: 700 13px/1 var(--f-display); font-stretch: var(--num-stretch); color: var(--ink-2); }
  .cmdk-go { font-size: 16px; color: var(--acc); opacity: 0; transform: translateX(-4px); transition: opacity var(--t-fast), transform var(--t-fast); }
  .cmdk-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-4); flex: none; }
  .cmdk-foot span { display: inline-flex; align-items: center; gap: 6px; }
  .cmdk-empty { padding: 36px 16px; text-align: center; color: var(--ink-3); }
  @media (max-width: 720px) { .cmdk { padding: 0; align-items: stretch; } .cmdk-box { width: 100%; max-height: none; border-radius: 0; } .cmdk-foot { display: none; } }

  /* ======== toast =================================================== */
  .toasts { position: fixed; z-index: var(--z-toast); left: 50%; bottom: calc(24px + var(--tabbar-h)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
  .toast { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: var(--s4); color: var(--ink); box-shadow: var(--shadow-2); font-weight: 560; font-size: 13.5px; animation: toast-in .4s var(--spring) both; }
  .toast .i { color: var(--up); font-size: 17px; }
  .toast.is-out { animation: toast-out .25s ease forwards; }
  @keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.9); } }
  @keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

  /* ======== boot (server copy shown until the page script draws) ==== */
  .boot { padding-block: 28px; }
  .boot .panel { padding: 20px; margin-bottom: 14px; }
  .boot h1 { font: 850 32px/1 var(--f-display); font-stretch: var(--display-stretch); text-transform: uppercase; margin-bottom: 14px; }
  .boot h2, .boot h3 { font: 700 15px/1.2 var(--f-display); text-transform: uppercase; margin: 18px 0 10px; letter-spacing: .04em; }
  .boot ul { display: grid; gap: 6px; color: var(--ink-2); }
  .boot p { color: var(--ink-2); margin: 6px 0; }
  .boot a { color: var(--acc-hi); }
  .boot .lb-table { width: 100%; font-size: 13.5px; }
  .boot .lb-table th { text-align: left; padding: 8px 10px; font: 650 10.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4); border-bottom: 1px solid var(--line-2); }
  .boot .lb-table td { padding: 10px; border-bottom: 1px solid var(--line); }
  html.js .boot-copy { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  html:not(.js) .boot-ph { display: none; }
  .boot-ph { display: grid; gap: 14px; }
  .boot-notice { margin: 10px 0 18px; padding: 12px 14px; border-radius: var(--r); background: color-mix(in srgb, var(--down) 12%, transparent); color: var(--ink); }
  .boot-notice a { color: var(--acc-hi); font-weight: 600; }
  .boot.is-failed .boot-copy { position: static; width: auto; height: auto; clip: auto; }
  .boot.is-failed .boot-ph { display: none; }

  /* ======== entrance ===============================================
     Content does not animate in: a block that already shows its skeleton
     just fills. Only explicit one-off moments (a hero, a dialog) move. */
  .rise, .stagger > * { animation: none; }
  [data-reveal] { opacity: 1; transform: none; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
  @keyframes pulse-dot { 50% { opacity: .35; transform: scale(.8); } }

  /* ======== cross-document page transitions ========================= */
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: hdr; }
  .tabbar { view-transition-name: tabbar; }
  ::view-transition-old(root) { animation: vt-out .22s var(--ease-io) both; }
  ::view-transition-new(root) { animation: vt-in .38s var(--ease-out) both; }
  ::view-transition-group(hdr), ::view-transition-group(tabbar) { animation: none; }
  @keyframes vt-out { to { opacity: 0; } }
  @keyframes vt-in { from { opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }
}

/* ------------------------------------------------------------- utilities -- */
@layer utilities {
  .muted { color: var(--ink-3); }
  .dim { color: var(--ink-4); }
  .small { font-size: 12.5px; }
  .mono { font-family: var(--f-mono); }
  .up { color: var(--up); }
  .down { color: var(--down); }
  .acc { color: var(--acc); }
  .nowrap { white-space: nowrap; }
  .ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
  .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
  .w-full { width: 100%; }
  .center { text-align: center; }
  .right { text-align: right; }
  .hidden { display: none !important; }
}
@layer components {
  @media (max-width: 860px) { .hdr-burger { display: none; } .hero-hint > :nth-last-child(-n+2) { display: none; } }
}

/* ---------------------------------------------------------------- charts -- */
@layer components {
  .chart-card { position: relative; }
  .chart-h { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title actions" "meta actions"; gap: 6px 16px; align-items: center; padding: 16px 18px 12px; }
  .chart-h h3 { grid-area: title; font: 800 14px/1.2 var(--f-display); font-stretch: 112%; letter-spacing: .05em; text-transform: uppercase; }
  .cc-meta { grid-area: meta; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; color: var(--ink-3); font-size: 12.5px; }
  .cc-meta:empty { display: none; }
  .cc-actions { grid-area: actions; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .chart-plot { padding: 0 12px 14px; min-height: 120px; }
  .cc-chip { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); font-weight: 600; }
  .cc-chip .i { font-size: 14px; color: var(--ink-3); }
  .cc-delta { font-weight: 700; font-variant-numeric: tabular-nums; }
  .cc-delta.up { color: var(--up); } .cc-delta.down { color: var(--down); } .cc-delta.flat { color: var(--ink-3); }
  .cc-dim { color: var(--ink-3); }
  .cc-live { display: inline-flex; align-items: center; gap: 6px; }
  .cc-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 20%, transparent); animation: pulse-dot 2s ease-in-out infinite; }
  .cc-next { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
  .cc-next:empty { display: none; }
  .cc-next .i { font-size: 14px; }
  .cc-ranges { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2); }
  .cc-range { height: 28px; min-width: 38px; padding: 0 8px; border-radius: 7px; color: var(--ink-3); font: 700 12px/1 var(--f-mono); transition: background var(--t-fast), color var(--t-fast); }
  .cc-range:hover { color: var(--ink); }
  .cc-range.is-on { background: var(--acc); color: var(--acc-ink); box-shadow: 0 4px 14px -4px rgb(var(--acc-rgb) / .8); }
  .cc-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px; border-radius: var(--r-sm); background: var(--s2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 600; font-size: 12.5px; transition: background var(--t-fast), color var(--t-fast); }
  .cc-btn:hover { background: var(--s3); color: var(--ink); }
  .cc-btn .i { font-size: 16px; }
  .cc-icon { width: 34px; padding: 0; justify-content: center; }
  @media (max-width: 720px) {
    .chart-h { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "meta" "actions"; }
    .cc-actions { justify-content: flex-start; }
    .cc-ranges { flex: 1 1 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
    .chart-plot { padding: 0 4px 12px; }
  }

  .chart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 180px; padding: 24px; text-align: center; color: var(--ink-3); font-size: 13px; }
  .chart-empty .i { font-size: 26px; color: var(--ink-4); }
  .chart-empty b { color: var(--ink-2); }

  .chartz { position: relative; }
  .chartz-svg, .chartv-svg { width: 100%; height: auto; display: block; overflow: visible; outline: none; }
  .chartz-glow { display: none; }
  .chartz-svg { touch-action: pan-y; }
  .chartz-svg text, .chartv-svg text { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
  .chartz-line.is-drawing, .chartz-glow.is-drawing { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.3s var(--ease-out) forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  .chartz-area.is-new { animation: fade-in .9s var(--ease) .35s both; }
  .chartz-dots.is-new .chartz-dot { transform-box: fill-box; transform-origin: center; animation: dot-pop .35s var(--spring) var(--d, .3s) both; }
  .chartz-deltas.is-new { animation: fade-in .5s ease 1s both; }
  .chartz-end.is-new { animation: fade-in .4s ease 1.05s both; }
  .chartz-pulse { transform-box: fill-box; transform-origin: center; animation: chart-pulse 2.4s ease-out 1.4s infinite; opacity: 0; }
  .chartz-cursor, .chartz-cursor-halo { pointer-events: none; }
  @keyframes dot-pop { from { opacity: 0; transform: scale(0); } }
  @keyframes chart-pulse { 0% { opacity: .45; transform: scale(.6); } 70%, 100% { opacity: 0; transform: scale(2.2); } }
  .chartz-tip, .chartv-tip {
    position: absolute; z-index: 5; pointer-events: none; min-width: 180px; padding: 14px 16px;
    display: flex; flex-direction: column; gap: 10px; font-size: 12px; color: var(--ink-2);
    border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--s2);
    box-shadow: 0 12px 32px #0008, 0 3px 8px #0005;
  }
  .chartz-tip-title, .chartv-tip-title {
    display: flex; align-items: center; gap: 8px; font: 600 10px/1.4 var(--f-mono);
    color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em;
  }
  .chartz-tip-title::before, .chartv-tip-title::before {
    content: ''; flex: none; width: 3px; height: 10px; background: var(--acc); transform: skewX(-16deg);
  }
  .chartz-val { font: 850 30px/1 var(--f-display); font-stretch: 80%; color: var(--ink); font-variant-numeric: tabular-nums; }
  .chartz-val small { margin-left: 5px; font: 600 10px/1.3 var(--f-mono); color: var(--ink-3); }
  .chartz-row { display: flex; flex-wrap: wrap; gap: 6px; }
  .chartz-delta, .chartz-flat { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 5px; font: 600 11px/1.2 var(--f-mono); font-variant-numeric: tabular-nums; }
  .chartz-delta.up { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); }
  .chartz-delta.down { color: var(--down); background: color-mix(in srgb, var(--down) 12%, transparent); }
  .chartz-flat { color: var(--ink-3); background: var(--s3); }
  .chartz-sub, .chartv-sub { display: flex; align-items: center; gap: 7px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 9px; font-size: 11px; line-height: 1.45; }
  .chartz-tip-ic { width: 20px; height: 20px; flex: none; object-fit: contain; }
  .chartz-reset { position: absolute; top: 8px; right: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 7px; background: var(--s4); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 12px; font-weight: 650; color: var(--ink); }
  .chartz-reset .i { font-size: 14px; }
  .chartz-caption, .chartv-caption { margin-top: 8px; padding: 8px 10px 0; border-top: 1px solid var(--line); color: var(--ink-4); font: 500 11px/1.3 var(--f-mono); }
  .chartz-touch-hint { display: none; }
  @media (hover: none) { .chartz-desktop-hint { display: none; } .chartz-touch-hint { display: inline; } }
  .chartv-scroll { overflow-x: auto; scrollbar-width: thin; }
  .chartv { position: relative; }
  .chartv-bar { transform-box: fill-box; transform-origin: bottom; animation: none; animation-delay: var(--d, 0s); transition: opacity .18s, filter .18s; }
  @keyframes grow-y { from { transform: scaleY(0); } }
  .chartv-svg:has(.chartv-bar.hot) .chartv-bar:not(.hot) { opacity: .5; }
  .chartv-bar.hot { filter: brightness(1.15) drop-shadow(0 0 6px color-mix(in srgb, var(--chart-color, var(--acc)) 40%, transparent)); }
  .chartv-col { transition: opacity .15s, x .12s ease; pointer-events: none; }
  .chartv-value { pointer-events: none; transition: opacity .12s; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
  .modal-chart:empty { min-height: 420px; }
  @media (max-width: 720px) { .modal-chart:empty { min-height: 260px; } }
  @media (prefers-reduced-motion: reduce) {
    .chartz-line.is-drawing, .chartz-glow.is-drawing { animation: none; stroke-dashoffset: 0; }
  }
}
@layer components { .chartv-svg text.chartv-band-label { font-family: var(--f-ui); } }

@layer components {
  .panel-t { font: 700 13px/1.2 var(--f-display); font-stretch: 112%; letter-spacing: .06em; text-transform: uppercase; display: flex; align-items: center; gap: 9px; }
  .panel-t .i { font-size: 17px; color: var(--acc); }
  .panel-t .meta { margin-left: 6px; text-transform: none; letter-spacing: 0; }
  .sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 28px 0 14px; flex-wrap: wrap; }
  .sec-head:first-child { margin-top: 0; }
  .sec-head h2 { font: 800 17px/1.15 var(--f-display); font-stretch: 114%; letter-spacing: .03em; text-transform: uppercase; }
  .sec-head h2 small { font: 500 11px/1 var(--f-mono); color: var(--ink-4); letter-spacing: .06em; margin-left: 8px; }
  .sec-head p { margin-top: 6px; max-width: 760px; }
  .lg-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
  .tab-count, .tab .count { margin-left: 2px; }
}
@layer components { .modal-panel:focus, .modal-panel:focus-visible { outline: none; } }

/* -------------------------------------------- page head: art + legacy hooks -- */
@layer components {
  .phead[style*="--art"]::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--art) center 40% / cover no-repeat; opacity: .2; filter: saturate(.85); -webkit-mask-image: linear-gradient(180deg, #000 10%, transparent 92%); mask-image: linear-gradient(180deg, #000 10%, transparent 92%); }
  .phead[style*="--art"]::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--bg) 5%, transparent 55%, color-mix(in srgb, var(--bg) 60%, transparent)); pointer-events: none; }
  .phead h1:not(.phead-title) { font: 850 clamp(30px, 4.4vw, 52px)/.95 var(--f-display); font-stretch: var(--display-stretch); letter-spacing: -.01em; text-transform: uppercase; transform: skewX(-6deg); transform-origin: left bottom; }
  .phead h1 em, .phead h1 .em { font-style: normal; color: var(--acc); }
  .phead-sub { color: var(--ink-2); font-size: 15px; margin-top: 12px; max-width: 760px; }
  .phead-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .phead .phead-row + .tabs, .phead .wrap > .tabs, .phead .tabs { margin-top: 22px; }
  .phead .tabs { border-bottom: 1px solid var(--line); }
  .tab.is-on, .tab.active { color: var(--ink); }
  .tab .i { font-size: 16px; color: var(--ink-3); }
  .tab.is-on .i, .tab.active .i { color: var(--acc); }
  .boot-ph .boot-heading { height: 40px; width: 40%; border-radius: 8px; }
  .boot-ph .boot-line { height: 14px; width: 70%; border-radius: 6px; }
  .boot-ph .boot-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .boot-ph .boot-card { height: 180px; border-radius: 14px; }
  .boot-ph .sk, .boot-ph [class^="boot-"] { background: var(--s2); }
  .sec-title { font: 800 17px/1.15 var(--f-display); font-stretch: 114%; letter-spacing: .03em; text-transform: uppercase; display: flex; align-items: baseline; gap: 8px; }
  .sec-title small { font: 500 11px/1 var(--f-mono); color: var(--ink-4); letter-spacing: .06em; }
}
@layer tokens {
  /* names older page styles were written against */
  :root {
    --acc-a08: rgb(var(--acc-rgb) / .08); --acc-a16: rgb(var(--acc-rgb) / .16); --acc-a30: rgb(var(--acc-rgb) / .3);
    --up-a12: color-mix(in srgb, var(--up) 12%, transparent); --down-a12: color-mix(in srgb, var(--down) 12%, transparent);
    --gold-a12: color-mix(in srgb, var(--gold) 12%, transparent); --cash: var(--hi);
    --r-md: 12px; --row: var(--s1); --row-alt: var(--s2); --row-hover: var(--s3); --band: var(--s2); --bg-soft: var(--bg-2);
    --cut-shape: var(--cut-tr); --cut-shape-2: var(--cut-bl); --f-brand: var(--f-display);
    --bar-h: var(--hdr-h); --nav-h: var(--hdr-h);
    --text-primary: var(--ink); --text-secondary: var(--ink-2); --text-muted: var(--ink-3);
    --primary-color: var(--acc); --primary-light: var(--acc-hi); --primary-dark: var(--acc-lo); --primary-soft: var(--acc-a16); --primary-glow: var(--acc-a30); --primary-ink: #fff;
    --surface-color: var(--s1); --surface-2: var(--s2); --surface-3: var(--s3); --background-color: var(--bg); --line-strong: var(--line-3);
    --success-color: var(--up); --error-color: var(--down); --warning-color: var(--gold);
  }
}

/* ------------------------------------------- shared bits used by page scripts -- */
@layer components {
  /* entity head (club page, banned record): crest + identity */
  .pf-head { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
  .pf-id { flex: 1; min-width: 0; }
  .pf-kicker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
  .pf-name { font: 900 clamp(32px, 5vw, 60px)/.95 var(--f-display); font-stretch: 122%; text-transform: uppercase; transform: skewX(-7deg); transform-origin: left bottom; }
  .pf-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
  .s-av { width: 30px; height: 30px; flex: none; display: inline-grid; place-items: center; border-radius: 8px; background: hsl(var(--club-h, 340) 45% 22%); color: hsl(var(--club-h, 340) 80% 80%); font: 800 13px/1 var(--f-display); }
  .member-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; padding: 10px; max-height: 560px; overflow-y: auto; }
  .member-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm); min-width: 0; transition: background var(--t-fast); }
  .member-chip:hover { background: var(--s2); }
  .m-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* simple list rows */
  .list { display: flex; flex-direction: column; }
  .li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
  .li:last-child { border-bottom: 0; }
  .li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .li-title { font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .li-sub { font-size: 12px; color: var(--ink-3); }
  .li-value { font: 800 16px/1 var(--f-display); font-stretch: 72%; }
  .bar-track { display: block; width: 72px; height: 4px; border-radius: 2px; background: var(--s4); overflow: hidden; }
  .bar-fill { display: block; height: 100%; background: var(--acc); border-radius: inherit; }
  .live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 20%, transparent); }
}
@layer components { .league { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; } .league img { flex: none; } }

/* ------------------------------------------------- big search box (omni) -- */
@layer components {
  .omni { position: relative; display: flex; align-items: center; gap: 8px; max-width: 760px; height: 60px; margin-top: 22px; padding: 8px 8px 8px 18px; border-radius: 16px; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 0 0 1px var(--line-3), 0 24px 60px -28px #000; transition: box-shadow var(--t); }
  .omni:focus-within { box-shadow: 0 0 0 1px rgb(var(--acc-rgb) / .7), 0 0 0 6px rgb(var(--acc-rgb) / .14), 0 24px 60px -28px #000; }
  .omni > .i, .omni-ic { font-size: 21px; color: var(--acc); flex: none; }
  .omni input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; font-size: 16px; color: var(--ink); }
  .omni input::placeholder { color: var(--ink-4); }
  .omni .btn { height: 44px; }
  .gs-filter-toggle { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; color: var(--ink-2); background: var(--s2); box-shadow: inset 0 0 0 1px var(--line-2); transition: background var(--t-fast), color var(--t-fast); }
  .gs-filter-toggle:hover, .gs-filter-toggle[aria-expanded="true"] { background: var(--s3); color: var(--ink); }
  .gs-filter-toggle .i { font-size: 19px; }
  .gs-filter-count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--acc); color: #fff; font: 700 10.5px/18px var(--f-mono); text-align: center; }
  .field-label { display: block; font: 600 10.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 7px; }
  .dir-filters, .gs-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; align-items: end; max-width: 980px; margin-top: 14px; padding: 16px; border-radius: var(--r-lg); background: var(--s1); box-shadow: inset 0 0 0 1px var(--line-2); animation: pop-in .2s var(--ease-out); }
  .dir-filters .field, .gs-filters .field, label.field:has(> .field-label) { flex-direction: column; align-items: stretch; }
  .dir-filters .sel, .gs-filters .sel { width: 100%; }
  .gs-searchwrap { position: relative; }
  @media (max-width: 640px) { .omni { height: 54px; } .omni .btn span:first-child { display: none; } .omni .btn { width: 44px; padding: 0; } }
}
@layer components { .handle { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; } .handle svg { width: 14px; height: 14px; opacity: .95; } }
@layer components { .pc-plats { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; } .pc-plats > span { display: inline-flex; align-items: center; gap: 5px; } .pc-plats svg { width: 13px; height: 13px; opacity: .9; flex: none; color: var(--ink-2); } }

/* ------------------------------------------------ global search extras -- */
@layer components {
  .cmdk-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px 0; flex-wrap: wrap; }
  .cmdk-title > span { display: inline-flex; align-items: center; gap: 8px; font: 800 13px/1 var(--f-display); font-stretch: 112%; letter-spacing: .06em; text-transform: uppercase; }
  .cmdk-title > span .i { color: var(--acc); font-size: 17px; }
  .cmdk-title small { font-size: 11.5px; color: var(--ink-4); }
  .cmdk-in { height: 54px; border-bottom: 0; }
  .cmdk-scopes { margin: 0 12px 10px; align-self: flex-start; flex-wrap: wrap; }
  .cmdk-scopes > button { height: 28px; padding: 0 10px; }
  .cmdk-list { border-top: 1px solid var(--line); }
  .cmdk-group { display: flex; align-items: center; justify-content: space-between; }
  .cmdk-group button { font: 600 11px/1 var(--f-ui); letter-spacing: 0; text-transform: none; color: var(--ink-3); }
  .cmdk-group button:hover { color: var(--acc-hi); }
  .cmdk-item { color: var(--ink-2); }
  .cmdk-item:hover { color: var(--ink); }
  .cmdk-main small s { color: var(--ink-4); }
  .cmdk-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; }
  .cmdk-empty .i { font-size: 26px; color: var(--ink-4); }
  .cmdk-loading { padding: 8px 10px; }
  .cmdk-adv { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: var(--ink-3); font-weight: 600; }
  .cmdk-adv:hover { color: var(--acc-hi); }
  .cmdk-adv .i { font-size: 13px; }
}
@layer components {
  img.img-boxed { object-fit: cover !important; padding: 0 !important; border-radius: 12px; box-shadow: 0 0 0 1px var(--line-2), 0 8px 20px -8px #000; aspect-ratio: 1; width: auto !important; max-height: 100%; margin-inline: auto; }
}
@layer components { img.img-fade { opacity: 0; transition: opacity .35s var(--ease); } img.img-fade.is-loaded { opacity: 1; } }
@layer components {
  /* "active" is what older page code toggles; it reads exactly like is-on */
  .seg > .active, .seg > .is-on, .seg > [aria-pressed="true"], .seg > [aria-selected="true"] { background: rgb(var(--acc-rgb) / .16); color: #fff; box-shadow: inset 0 0 0 1px rgb(var(--acc-rgb) / .45); }
  .seg > .active .i, .seg > .is-on .i, .seg > [aria-pressed="true"] .i, .seg > [aria-selected="true"] .i { color: var(--acc-hi); }
  .tab.active, .tab.is-on, .tab[aria-current="page"] { color: var(--ink); }
}
@layer components {
  /* header search: a proper field, not a button */
  .cmdk-btn { width: 280px; height: 40px; padding: 0 6px 0 12px; gap: 10px; background: var(--bg-2); border-color: var(--line-2); box-shadow: inset 0 1px 2px #0006; }
  .cmdk-btn > .i { color: var(--acc); font-size: 16px; }
  .cmdk-btn-t { flex: 1; text-align: left; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cmdk-btn:hover .cmdk-btn-t { color: var(--ink-2); }
  .cmdk-btn:hover { border-color: rgb(var(--acc-rgb) / .45); background: var(--s1); }
  .cmdk-btn-k { display: inline-flex; gap: 3px; }
  .cmdk-btn-k kbd { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 6px; font: 600 10.5px/1 var(--f-mono); color: var(--ink-3); background: var(--s3); box-shadow: inset 0 -2px 0 #0005, 0 0 0 1px var(--line-2); }
  @media (max-width: 1366px) { .cmdk-btn { width: 200px; } }
  @media (max-width: 1320px) { .hdr-link:has(.lbl-opt) { display: none; } .mega-item.more-opt { display: flex; } }
  @media (max-width: 1100px) { .cmdk-btn { width: auto; } }
  @media (max-width: 860px) { .cmdk-btn-k { display: none; } }
}
@layer components {
  .sk-rows { display: flex; flex-direction: column; }
  .sk-row { display: flex; align-items: center; gap: 12px; height: var(--rh, 52px); padding: 0 16px; border-bottom: 1px solid var(--line); }
  .sk-row:last-child { border-bottom: 0; }
  .sk-row .sk { animation-delay: var(--d, 0ms); }
  .sk-av { width: 30px; height: 30px; border-radius: 9px; flex: none; }
  .sk-row-main { flex: 1; display: flex; flex-direction: column; gap: 7px; }
  .sk-t { height: 11px; width: 38%; border-radius: 6px; }
  .sk-s { height: 9px; width: 24%; border-radius: 5px; opacity: .7; }
  .sk-v { width: 64px; height: 14px; border-radius: 6px; flex: none; }
}
@layer components {
  .card-foot { padding: 12px 16px; border-top: 1px solid var(--line); }
  .card-foot a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
  .card-foot a:hover { color: var(--acc-hi); }
}
@layer components { .tab .count:empty, .count:empty { display: none; } }
@layer components {
  /* collapsible filter panels: animate height with grid rows */
  .dir-filters { display: grid; grid-template-rows: 0fr; opacity: 0; margin-top: 0; padding-block: 0; box-shadow: none; visibility: hidden; animation: none;
    transition: grid-template-rows .35s var(--ease-out), opacity .25s ease, margin-top .35s var(--ease-out), padding .35s var(--ease-out), visibility 0s .35s; }
  .dir-filters > * { min-height: 0; }
  .dir-filters.is-open { grid-template-rows: 1fr; opacity: 1; margin-top: 14px; padding-block: 16px; box-shadow: inset 0 0 0 1px var(--line-2); visibility: visible;
    transition: grid-template-rows .35s var(--ease-out), opacity .25s ease .05s, margin-top .35s var(--ease-out), padding .35s var(--ease-out), visibility 0s; }
  /* page-head art keeps one height, so a panel opening below does not rescale it */
  .phead[style*="--art"]::before, .phead[style*="--art"]::after { bottom: auto; height: 380px; }
}
@layer components {
  .dir-filters { grid-template-columns: minmax(0, 1fr); overflow: hidden; }
  .dir-filters-in { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; align-items: end; overflow: hidden; }
}

@layer components {
  .phead::after, .phead[style*="--art"]::after { opacity: .16;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 85%, transparent), linear-gradient(0deg, transparent 0%, #000 30%);
    -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent 0%, #000 30%, #000 85%, transparent), linear-gradient(0deg, transparent 0%, #000 30%); mask-composite: intersect; }
  .phead::before, .phead[style*="--art"]::before {
    background:
      radial-gradient(26% 55% at var(--sweep, 70%) 45%, rgb(var(--acc-rgb) / .10), transparent 70%),
      radial-gradient(40% 90% at 88% -10%, rgb(var(--acc-rgb) / .24), transparent 70%),
      radial-gradient(28% 70% at 62% -20%, color-mix(in srgb, var(--hi) 9%, transparent), transparent 70%),
      radial-gradient(30% 60% at 0% 0%, rgb(var(--acc-rgb) / .09), transparent 70%);
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent);
  }
}
@layer components {
  /* A returning signed-in visitor never sees "Sign in" flash before the avatar. */
  html.is-user .hdr-account [data-signin] { visibility: hidden; }
}

/* The scrollbar's room is always kept: a page that is short while it loads,
   or an open dialog (overflow hidden), no longer shifts the header sideways. */
@layer base {
  html { scrollbar-gutter: stable; }
}

/* ======== account popovers: notifications ===========================
   Both popovers open with a fade and a reveal from the top (no scale, so
   nothing re-rasterizes) and close the same way; browsers without
   @starting-style simply show them. In the notification panel the rows come
   in one after another. */
@layer components {
  .acct-pop {
    animation: none; transform-origin: top right;
    opacity: 1; clip-path: inset(-30px -30px -60px -30px round var(--r-lg));
    transition: opacity .16s ease, clip-path .26s var(--ease-out), display .26s allow-discrete;
  }
  .acct-pop[hidden] { opacity: 0; clip-path: inset(0 0 100% 0 round var(--r-lg)); }
  @starting-style { .acct-pop:not([hidden]) { opacity: 0; clip-path: inset(0 0 100% 0 round var(--r-lg)); } }

  .acct-bellpop {
    width: 384px; padding: 0; overflow: hidden;
    background: linear-gradient(180deg, color-mix(in srgb, var(--s3) 60%, var(--s2)), var(--s2) 120px);
    box-shadow: inset 0 0 0 1px var(--line-2), 0 28px 70px -24px #000, 0 0 0 1px #0006;
  }
  .acct-bellpop::before { content: ''; position: absolute; inset: 0 0 auto; height: 70px; pointer-events: none;
    background: radial-gradient(70% 100% at 100% 0%, rgb(var(--acc-rgb) / .12), transparent 70%); }
  .acct-pophead { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--line); }
  .acct-pophead b { display: inline-flex; align-items: center; gap: 10px; font: 800 14px/1 var(--f-display); font-stretch: 112%; letter-spacing: .03em; text-transform: uppercase; }
  .nt-count { padding: 4px 7px; border-radius: 999px; background: rgb(var(--acc-rgb) / .16); color: var(--acc); font: 700 10px/1 var(--f-mono); font-style: normal; letter-spacing: .06em; text-transform: uppercase; }
  .acct-pophead button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; color: var(--ink-3); font-size: 12px; font-weight: 600; transition: background var(--t-fast), color var(--t-fast); }
  .acct-pophead button .i { font-size: 14px; }
  .acct-pophead button:hover { background: var(--s3); color: var(--ink); }

  .acct-list { max-height: min(440px, 62vh); overflow-y: auto; overscroll-behavior: contain; padding: 4px 0 6px; scrollbar-width: thin; scrollbar-color: var(--s4) transparent; }
  .nt-label { padding: 10px 16px 6px; font: 700 10px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); }

  .acct-noti {
    --nk: var(--ink-2);
    position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start;
    margin: 0 6px; padding: 10px 10px; border: 0; border-radius: 10px;
    transition: background var(--t-fast);
  }
  .acct-noti:hover { background: #ffffff08; }
  .acct-noti[data-kind="news"] { --nk: var(--acc); }
  .acct-noti[data-kind="tracker"] { --nk: var(--hi); }
  .acct-noti[data-kind="account"] { --nk: #6aa8ff; }
  .acct-noti.is-unread { background: linear-gradient(90deg, rgb(var(--acc-rgb) / .09), transparent 70%); }
  .acct-noti.is-unread::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: var(--acc); box-shadow: 0 0 10px rgb(var(--acc-rgb) / .7); }
  .acct-noti-ic { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--nk); background: color-mix(in srgb, var(--nk) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nk) 22%, transparent); }
  .acct-noti-ic .i { font-size: 17px; }
  .acct-noti-main { min-width: 0; }
  .acct-noti-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
  .acct-noti b { display: block; min-width: 0; font-size: 13px; font-weight: 650; line-height: 1.3; color: var(--ink); }
  .acct-noti.is-unread b::after { content: none; }
  .acct-noti time { flex: none; font: 500 10.5px/1.3 var(--f-mono); color: var(--ink-4); white-space: nowrap; }
  .acct-noti.is-unread time { color: var(--acc); }
  .acct-noti p { margin: 3px 0 0; color: var(--ink-3); font-size: 12.5px; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .acct-bellpop:not([hidden]) .acct-noti { animation: nt-in .34s var(--ease-out) backwards; animation-delay: calc(var(--k, 0) * 35ms + 70ms); }
  @keyframes nt-in { from { opacity: 0; transform: translateY(6px); } }

  .acct-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 24px 30px; text-align: center; color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
  .acct-empty b { color: var(--ink); font-size: 13.5px; font-weight: 650; }
  .acct-empty-ic { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 6px; border-radius: 14px; background: var(--s3); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-2); }
  .acct-empty-ic .i { font-size: 22px; }

  .nt-sk { display: flex; flex-direction: column; gap: 4px; padding: 6px 16px 8px; }
  .nt-sk-row { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 6px 0; }
  .nt-sk-row > .sk { width: 36px; height: 36px; border-radius: 10px; }
  .nt-sk-row > span:last-child { display: flex; flex-direction: column; gap: 7px; padding-top: 3px; }
  .nt-sk-row > span:last-child .sk { height: 9px; border-radius: 4px; }
  .nt-sk-row > span:last-child .sk:first-child { width: 62%; }
  .nt-sk-row > span:last-child .sk:last-child { width: 88%; }

  .acct-foot { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; font-weight: 600; transition: color var(--t-fast), background var(--t-fast); }
  .acct-foot .i { font-size: 14px; transition: transform .25s var(--ease-out); }
  .acct-foot:hover { color: var(--acc); background: #ffffff05; }
  .acct-foot:hover .i { transform: translateX(3px); }

  /* The bell: the badge breathes while something is unread; it rings once when opened. */
  .acct-badge:not([hidden]) { animation: nt-badge 2.4s ease-in-out infinite; }
  @keyframes nt-badge { 0%, 70%, 100% { box-shadow: 0 0 0 2px var(--bg), 0 0 0 2px rgb(var(--acc-rgb) / .5); } 35% { box-shadow: 0 0 0 2px var(--bg), 0 0 0 6px rgb(var(--acc-rgb) / 0); } }
  .acct-bell[aria-expanded="true"] > .i { animation: nt-ring .5s var(--ease-out); transform-origin: 50% 10%; }
  @keyframes nt-ring { 20% { rotate: 14deg; } 45% { rotate: -10deg; } 70% { rotate: 5deg; } }
  @media (prefers-reduced-motion: reduce) { .acct-pop, .acct-bellpop .acct-noti, .acct-badge, .acct-bell > .i { animation: none !important; transition: none; } }
}

@layer components {
  /* Header search: narrower, so the bar does not crowd the nav and the
     account tools (same shrink steps as before, each one smaller). */
  .cmdk-btn { width: 220px; }
  @media (max-width: 1366px) { .cmdk-btn { width: 180px; } }
  @media (max-width: 1240px) { .cmdk-btn { width: 150px; } }
  @media (max-width: 1100px) { .cmdk-btn { width: auto; max-width: 240px; } }

  /* The close button only exists for the full-screen phone panel. */
  .acct-pophead .acct-close { display: none; }

  /* Phones: the bell is back (it used to be hidden below 720px, which left no
     way to read notifications on mobile) and its panel takes the whole screen. */
  @media (max-width: 720px) {
    .hdr-account .acct-bell { display: inline-grid; }
    .cmdk-btn { max-width: 190px; }
    html.acct-noti-open { overflow: hidden; }
    html.acct-noti-open .hdr { -webkit-backdrop-filter: none; backdrop-filter: none; }
    .hdr-account .acct-bellpop {
      position: fixed; inset: 0; z-index: 1000;
      width: 100%; max-width: none; height: 100%; height: 100dvh;
      display: flex; flex-direction: column;
      border-radius: 0; box-shadow: none;
      padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
      clip-path: none; transform-origin: top center;
      transition: opacity .18s ease, transform .22s var(--ease-out), display .22s allow-discrete;
    }
    .hdr-account .acct-bellpop[hidden] { opacity: 0; transform: translateY(12px); clip-path: none; }
    @starting-style { .hdr-account .acct-bellpop:not([hidden]) { opacity: 0; transform: translateY(12px); clip-path: none; } }
    .hdr-account .acct-bellpop .acct-pophead { flex: none; padding: 14px 10px 12px 16px; }
    .hdr-account .acct-bellpop .acct-pophead .acct-close { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; margin-left: 2px; border-radius: 10px; color: var(--ink-2); }
    .hdr-account .acct-bellpop .acct-pophead .acct-close .i { font-size: 20px; }
    /* the action next to the title becomes an icon button, so the head stays one line */
    .hdr-account .acct-bellpop .acct-pophead button:not(.acct-close) { width: 38px; height: 38px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
    .hdr-account .acct-bellpop .acct-pophead button:not(.acct-close) .i { font-size: 18px; }
    /* the bottom tab bar sits outside the header and would cover the panel */
    html.acct-noti-open .tabbar { display: none; }
    .hdr-account .acct-bellpop .acct-pophead > b { margin-right: auto; }
    .hdr-account .acct-bellpop .nt-tabs { flex: none; }
    .hdr-account .acct-bellpop .acct-list { flex: 1; min-height: 0; max-height: none; }
    .hdr-account .acct-bellpop .acct-foot { flex: none; padding: 14px; }
  }
}
