  :root {
    color-scheme: dark;
    --bg: #08090a; --panel: #0f1011; --surface: #191a1b; --surface-2: #28282c;
    --ink: #f7f8f8; --ink-2: #d0d6e0; --muted: #8a8f98; --dim: #62666d;
    --accent: #5e6ad2; --accent-2: #7170ff; --accent-hi: #828fff;
    --green: #10b981; --green-bg: rgba(16,185,129,0.14);
    --red: #f23f43; --red-bg: rgba(242,63,67,0.12);
    --line: rgba(255,255,255,0.08); --line-soft: rgba(255,255,255,0.05);
    --line-solid: #23252a; --line-strong: rgba(255,255,255,0.16);
    --wash-0: rgba(255,255,255,0.03); --wash-1: rgba(255,255,255,0.05); --wash-2: rgba(255,255,255,0.08);
    --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-pill: 9999px;
  }
  html[data-theme="light"] {
    color-scheme: light;
    --bg: #f2f3f5; --panel: #ffffff; --surface: #e9ebee; --surface-2: #dde0e5;
    --ink: #101215; --ink-2: #2a2f37; --muted: #667080; --dim: #98a0ab;
    --accent: #5e6ad2; --accent-2: #5b5bd6; --accent-hi: #4644c9;
    --green: #0e9f6e; --green-bg: rgba(14,159,110,0.12);
    --red: #e02424; --red-bg: rgba(224,36,36,0.10);
    --line: rgba(0,0,0,0.12); --line-soft: rgba(0,0,0,0.07);
    --line-solid: #d9dbdf; --line-strong: rgba(0,0,0,0.22);
    --wash-0: rgba(0,0,0,0.03); --wash-1: rgba(0,0,0,0.05); --wash-2: rgba(0,0,0,0.09);
  }
  html[data-theme="light"] .lvl { color: #047857; }
  html[data-theme="light"] .ban { color: #b91c1c; }
  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-feature-settings: "cv01", "ss03";
    background: var(--bg); color: var(--ink-2);
    font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  a { color: var(--accent-2); text-decoration: none; }
  a:hover { color: var(--accent-hi); }

  header {
    background: var(--panel); padding: 12px 20px; display: flex; align-items: center; gap: 14px;
    position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line-soft);
    backdrop-filter: blur(8px); box-shadow: 0 4px 16px -10px rgba(0,0,0,0.55);
  }
  header h1 { margin: 0; font-size: 15px; font-weight: 590; letter-spacing: -0.01em; color: var(--ink); }
  header form { display: flex; gap: 8px; flex: 1; max-width: 560px; position: relative; }
  #suggestBox { position: absolute; top: 100%; left: 0; right: 0; margin-top: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: rgba(0,0,0,0.5) 0 12px 40px; max-height: 420px; overflow: auto; display: none; z-index: 60; }
  .sg-h { padding: 8px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
  .sg-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; cursor: pointer; }
  .sg-row:hover, .sg-row.sel { background: var(--wash-2); }
  .sg-row img.sg-av { width: 26px; height: 26px; border-radius: 4px; background: var(--panel); flex-shrink: 0; }
  .sg-row img.sg-cap { width: 56px; height: auto; border-radius: 3px; background: var(--panel); flex-shrink: 0; }
  .sg-name { color: var(--ink); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sg-sub { color: var(--muted); font-size: 11.5px; margin-left: auto; white-space: nowrap; }
  header input {
    flex: 1; padding: 7px 12px; border-radius: var(--r-sm); border: 1px solid var(--line);
    background: var(--wash-0); color: var(--ink); font: inherit; font-size: 13.5px;
  }
  header input::placeholder { color: var(--muted); }
  header input:focus { outline: none; border-color: var(--accent-2); }
  header button, .btn {
    padding: 7px 14px; border-radius: var(--r-sm); cursor: pointer; font: inherit; font-size: 13px; font-weight: 510;
    background: var(--wash-1); color: var(--ink-2); border: 1px solid var(--line);
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  }
  header button:hover, .btn:hover { background: var(--wash-2); border-color: var(--line-strong); color: var(--ink); }
  header button:active, .btn:active { transform: translateY(1px); }
  header button:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
  header button.on, .btn.on { background: var(--wash-2); border-color: var(--accent-2); color: var(--ink); }
  /* keyboard focus for clickable cards/rows (made focusable via role=button in app.js) */
  [role="button"]:focus-visible, .game-card:focus-visible, .search-row:focus-visible, .recent-card:focus-visible, tr.clickable:focus-visible, .bar-row.clickable:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }

  /* respect the OS "reduce motion" setting: neutralise shimmer/spin/pulse/modal pops */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  }

  .wrap { max-width: 1320px; margin: 0 auto; padding: 22px 20px 80px; }

  /* home: orientation strip + 2-column grid so secondary blocks sit side by
     side instead of one long scroll */
  .home-intro { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(94,106,210,0.10), rgba(113,112,255,0.03));
    border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 18px; margin-bottom: 20px; }
  .home-intro .hi-title { font-size: 16px; font-weight: 640; color: var(--ink); letter-spacing: -0.01em; }
  .home-intro .hi-links { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
  .home-intro .hi-chip { padding: 5px 12px; border-radius: var(--r-pill); border: 1px solid var(--line);
    background: var(--wash-0); color: var(--ink-2); font-size: 12.5px; cursor: pointer; transition: all 0.14s ease; }
  .home-intro .hi-chip:hover { border-color: var(--accent-2); color: var(--ink); background: var(--wash-2); }
  .home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
  .home-grid > * { min-width: 0; margin-top: 0 !important; }
  @media (max-width: 900px) { .home-grid { grid-template-columns: 1fr; } }
  .card {
    background: var(--wash-0); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 20px; margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.16), 0 10px 30px -22px rgba(0,0,0,0.55);
  }
  .muted { color: var(--muted); font-size: 13px; }
  .err { color: var(--red); }
  /* section header with a subtle accent tick so long pages are scannable */
  .section-h { margin: 22px 0 11px; color: var(--ink); font-size: 14px; font-weight: 590; letter-spacing: -0.01em; }
  .section-h::before { content: ""; display: inline-block; width: 3px; height: 0.82em; background: var(--accent-2); border-radius: 2px; margin-right: 8px; vertical-align: -1px; opacity: 0.8; }
  .rb-modal-head .section-h::before, .an-subnav .section-h::before { display: none; }
  .section-h:first-child { margin-top: 0; }

  .profile-head { display: flex; gap: 16px; align-items: center; }
  .profile-head img.avatar { width: 84px; height: 84px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); box-shadow: 0 4px 14px -8px rgba(0,0,0,0.6); }
  .ph-main { flex: 1 1 auto; min-width: 0; }
  .ph-meta { margin-top: 7px; display: flex; flex-wrap: wrap; align-items: center; }
  .ph-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; max-width: 280px; }
  .ph-actions .btn-share { margin: 0; }

  /* equipped Steam cosmetics: frame overlays the avatar, background sits behind the header */
  .avatar-wrap { position: relative; display: inline-block; flex: 0 0 auto; }
  .avatar-frame { position: absolute; left: -11%; top: -11%; width: 122%; height: 122%; max-width: none; pointer-events: none; }
  #profileHead.has-bg { position: relative; overflow: hidden; border-radius: var(--r); padding: 16px; }
  #profileHead.has-bg::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(8,9,12,0.72), rgba(8,9,12,0.38)); }
  #profileHead.has-bg .profile-head { position: relative; z-index: 2; }
  .head-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; pointer-events: none; }
  .profile-head h2 { margin: 0 0 4px; color: var(--ink); font-weight: 590; letter-spacing: -0.02em; font-size: 22px; }
  .app-hero { width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--r); margin-bottom: 14px; display: block; border: 1px solid var(--line); }

  .badge {
    display: inline-flex; align-items: center; padding: 2px 9px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 510;
    background: var(--wash-1); color: var(--ink-2); border: 1px solid var(--line); margin-right: 6px; margin-top: 4px;
  }
  .ban { background: var(--red-bg); color: #ff9b9b; border-color: rgba(242,63,67,0.3); }
  .lvl { background: var(--green-bg); color: #4ade80; border-color: rgba(16,185,129,0.3); }
  /* Metacritic chip, colored square-style by score (green 75+ / amber 50–74 / red) */
  .badge.mc { font-variant-numeric: tabular-nums; }
  .mc-hi { background: var(--green-bg); color: var(--green); border-color: rgba(16,185,129,0.35); }
  .mc-mid { background: rgba(240,178,50,0.16); color: #d99e1e; border-color: rgba(240,178,50,0.38); }
  .mc-lo { background: var(--red-bg); color: var(--red); border-color: rgba(242,63,67,0.35); }
  .ic { width: 1.05em; height: 1.05em; vertical-align: -0.16em; display: inline-block; flex: 0 0 auto; }
  .ic-lg .ic, .ic-lg.ic { width: 1.4em; height: 1.4em; }
  .rowic { display: inline-flex; align-items: center; justify-content: center; width: 22px; color: var(--muted); flex: 0 0 auto; }
  .rowic .ic { width: 17px; height: 17px; }
  .onboard { background: var(--wash-0); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
  .onboard .ob-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 620; color: var(--ink); margin-bottom: 12px; }
  .onboard .ob-steps { display: flex; flex-direction: column; gap: 10px; }
  .onboard .ob-step { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
  .onboard .ob-n { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--accent-2); color: #fff; }
  .onboard-slim { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-size: 13px; color: var(--muted); }
  .lock-teaser { padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); font-size: 13px; background: var(--wash-0); }
  .bell-wrap { position: relative; display: inline-block; }
  .bell-badge { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--r-pill); background: var(--red); color: #fff; font-size: 10.5px; font-weight: 600; line-height: 17px; text-align: center; }
  .bell-wrap > .btn { position: relative; }
  .bell-drop { position: absolute; top: calc(100% + 8px); right: 0; width: 340px; max-width: 86vw; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: rgba(0,0,0,0.4) 0 12px 40px; z-index: 70; padding: 6px; }
  .btn-steam { display: block; width: 100%; margin-top: 10px; background: linear-gradient(90deg, #1b2838, #2a475e); border-color: #2a475e; color: #e5e8ec; }
  .btn-steam:hover { border-color: #66c0f4; }
  .badge.xp { gap: 6px; }
  .xpbar { display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: var(--wash-2); overflow: hidden; vertical-align: middle; }
  .xpfill { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent-2), var(--green)); }
  .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
  .dot.on { background: var(--green); box-shadow: 0 0 6px rgba(16,185,129,0.7); }
  .dot.off { background: var(--dim); }

  .tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-soft); margin-top: 18px; flex-wrap: wrap; }
  .tab { background: none; border: 0; color: var(--muted); padding: 9px 14px; cursor: pointer; border-bottom: 2px solid transparent; font: inherit; font-size: 13.5px; font-weight: 510; }
  .tab:hover { color: var(--ink-2); }
  .tab.active { color: var(--ink); border-bottom-color: var(--accent-2); }
  .tab-panel { padding-top: 16px; }

  table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
  th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
  th { color: var(--muted); font-weight: 510; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
  td { font-variant-numeric: tabular-nums; }
  tbody td:first-child { color: var(--ink); }
  th.num, td.num { text-align: right; }
  /* right-align the numeric columns of the number-heavy tables */
  .radar-table th:nth-child(2), .radar-table td:nth-child(2), .radar-table th:nth-child(3), .radar-table td:nth-child(3) { text-align: right; }
  #libraryTable th:nth-child(n+2), #libraryTable td:nth-child(n+2) { text-align: right; }
  .lb-table th:nth-child(n+3), .lb-table td:nth-child(n+3) { text-align: right; }
  .clickable { cursor: pointer; transition: background 0.12s ease; }
  .clickable:hover { background: var(--wash-1); }
  .game-icon { width: 30px; height: 30px; background: var(--panel); border-radius: var(--r-sm); vertical-align: middle; }

  .info-grid { display: grid; grid-template-columns: 150px 1fr; gap: 9px 14px; font-size: 13.5px; }
  .info-grid .k { color: var(--muted); }
  /* .stat now matches .kpi so overview stats and analytics KPIs read identically */
  .stat { display: flex; flex-direction: column; flex: 1 1 130px; background: var(--wash-0); border: 1px solid var(--line-soft); padding: 13px 14px; border-radius: var(--r); }
  .stat b { font-size: 21px; color: var(--ink); font-weight: 590; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
  .stat .muted { font-size: 11.5px; margin-top: 5px; }

  .filter { width: 100%; padding: 8px 11px; margin-bottom: 10px; background: var(--wash-0); border: 1px solid var(--line); color: var(--ink); border-radius: var(--r-sm); font: inherit; font-size: 13px; }
  .filter:focus { outline: none; border-color: var(--accent-2); }
  /* native select dropdowns ignore the page theme on light-mode OS: force dark */
  select.filter { background: var(--surface); color: var(--ink); }
  select.filter option { background: var(--surface); color: var(--ink); }

  /* prominent share button (canvas PNG cards) + CSS tooltip via data-tip */
  .btn-share {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px;
    border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer;
    background: linear-gradient(135deg, #5e6ad2, #7170ff); color: #fff;
    font: inherit; font-size: 12.5px; font-weight: 510; position: relative;
    transition: filter 0.15s ease, transform 0.15s ease;
  }
  .btn-share:hover { filter: brightness(1.15); transform: translateY(-1px); }
  .btn-share svg { width: 14px; height: 14px; flex-shrink: 0; }
  [data-tip] { cursor: help; }
  .btn[data-tip], .game-card[data-tip], .section-h[data-tip], .rt-chip[data-tip] { cursor: pointer; }
  .tip-pop {
    position: fixed; z-index: 200; max-width: 280px; background: var(--surface-2); color: var(--ink);
    font-size: 12px; font-weight: 400; line-height: 1.4; padding: 8px 11px; border-radius: var(--r-sm);
    border: 1px solid var(--line); pointer-events: none; box-shadow: rgba(0,0,0,0.45) 0 8px 24px;
  }

  /* ── Roulette hero ── */
  .roulette-hero {
    background: linear-gradient(135deg, rgba(94,106,210,0.10), rgba(113,112,255,0.04));
    border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px;
  }
  .roulette-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
  .roulette-title { font-size: 20px; font-weight: 640; letter-spacing: -0.02em; color: var(--ink); }
  .roulette-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
  .rt-chip {
    padding: 5px 12px; border-radius: var(--r-pill); border: 1px solid var(--line);
    background: var(--wash-0); color: var(--ink-2); font: inherit; font-size: 12.5px; cursor: pointer;
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.1s ease;
  }
  .rt-chip:hover { border-color: var(--line-strong); color: var(--ink); }
  .rt-chip.on { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
  .rt-chip.rt-dim { opacity: 0.4; }
  .roulette-ctl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .btn-spin {
    background: linear-gradient(135deg, #5e6ad2, #7170ff); color: #fff; border-color: transparent;
    font-weight: 560; padding: 8px 18px; transition: filter 0.15s ease, transform 0.12s ease;
  }
  .btn-spin:hover { filter: brightness(1.12); transform: translateY(-1px); }
  .btn-spin:active { transform: translateY(0) scale(0.98); }
  .roulette-spinning { padding: 24px; text-align: center; color: var(--muted); font-size: 15px; animation: tada 0.8s ease infinite; }
  @keyframes tada { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }

  /* ── Game cards + never-empty covers ── */
  .roulette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
  .game-card {
    text-align: left; cursor: pointer; border-radius: var(--r); padding: 8px;
    border: 1px solid transparent; transition: background 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
  }
  .game-card:hover { background: var(--wash-0); border-color: var(--line); transform: translateY(-2px); box-shadow: 0 8px 20px -14px rgba(0,0,0,0.6); }
  .cover { position: relative; width: 100%; border-radius: 6px; overflow: hidden; background: var(--surface); }
  .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .cover-ph {
    position: absolute; inset: 0; align-items: center; justify-content: center; text-align: center;
    padding: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2);
    background: linear-gradient(135deg, var(--surface), var(--surface-2));
  }

  .progress { height: 7px; background: var(--wash-2); border-radius: var(--r-pill); overflow: hidden; margin-top: 6px; max-width: 260px; }
  .progress > div { height: 100%; background: var(--accent-2); border-radius: var(--r-pill); }

  .kpi-row { display: flex; gap: 10px; flex-wrap: wrap; }
  .kpi { flex: 1 1 130px; background: var(--wash-0); border: 1px solid var(--line-soft); padding: 13px 14px; border-radius: var(--r); transition: background 0.12s ease, border-color 0.12s ease; }
  .kpi:hover { background: var(--wash-1); border-color: var(--line); }
  .kpi .v { font-size: 21px; color: var(--ink); font-weight: 590; line-height: 1.2; word-break: break-word; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
  .kpi .v.up { color: var(--green); }
  .kpi .v.down { color: var(--red); }
  .kpi .l { color: var(--muted); font-size: 11.5px; margin-top: 5px; }

  .bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
  .bar-label { width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .bar-track { flex: 1; background: var(--wash-2); height: 12px; border-radius: var(--r-sm); overflow: hidden; }
  .bar-fill { height: 100%; background: var(--accent-2); border-radius: var(--r-sm); }
  .bar-val { width: 72px; text-align: right; font-size: 12px; color: var(--muted); }

  .ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
  .ach-card { background: var(--wash-0); border: 1px solid var(--line-soft); padding: 10px; border-radius: var(--r); font-size: 12.5px; opacity: 0.5; transition: opacity 0.14s ease; }
  .ach-card.on { opacity: 1; }
  .ach-icon { width: 32px; height: 32px; vertical-align: middle; margin-bottom: 4px; border-radius: var(--r-sm); }
  .ach-name { font-weight: 510; color: var(--ink-2); }

  .friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
  .friend-card { background: var(--wash-0); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 12px; cursor: pointer; text-align: center; transition: background 0.14s ease, border-color 0.14s ease; }
  .friend-card:hover { background: var(--wash-2); border-color: var(--line); }
  .friend-card .av { width: 60px; height: 60px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); }
  .friend-card .fr-name { color: var(--ink); font-weight: 510; margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .friend-card .game-banner { width: 100%; height: auto; border-radius: var(--r-sm); margin-top: 7px; }

  .recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
  .recent-card { background: var(--wash-0); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 11px; cursor: pointer; text-align: center; transition: background 0.14s ease, transform 0.12s ease, box-shadow 0.12s ease; }
  .recent-card:hover { background: var(--wash-1); transform: translateY(-2px); box-shadow: 0 8px 20px -14px rgba(0,0,0,0.55); }
  .recent-card img { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--panel); }
  .recent-name { color: var(--ink); font-weight: 510; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }

  .activity-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line-soft); }
  .activity-row[onclick] { cursor: pointer; border-radius: var(--r-sm); transition: background 0.12s ease; }
  .activity-row[onclick]:hover { background: var(--wash-1); }
  /* gaming passport (v2.0 identity hub) */
  .passport { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; background: linear-gradient(160deg, var(--wash-1), var(--wash-0)); }
  .pp-hero { margin-bottom: 12px; }
  .pp-persona { font-size: 22px; font-weight: 640; color: var(--ink); letter-spacing: -0.01em; }
  .pp-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
  .pp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .pp-card { border: 1px solid var(--line-soft); border-radius: var(--r); padding: 12px; background: var(--surface); }
  .pp-card-wide { grid-column: 1 / -1; }
  .pp-h { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 4px; }
  .pp-big { font-size: 26px; font-weight: 640; color: var(--accent-2); }
  .search-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-sm); cursor: pointer; transition: background 0.12s ease; }
  .search-row:hover { background: var(--wash-1); }
  .search-row img { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--panel); }
  .sr-name { color: var(--ink); font-weight: 510; }

  .pill { background: var(--wash-1); border: 1px solid var(--line); padding: 2px 8px; border-radius: var(--r-pill); font-size: 11px; color: var(--muted); }

  .modal { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; z-index: 100; animation: modalFade 0.18s ease; }
  .modal > * { animation: modalPop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
  @keyframes modalFade { from { opacity: 0; } }
  @keyframes modalPop { from { opacity: 0; transform: scale(0.96) translateY(10px); } }
  .modal-card { background: var(--surface); border: 1px solid var(--line); padding: 22px; border-radius: var(--r-lg); width: 320px; box-shadow: rgba(0,0,0,0.5) 0 12px 40px; }
  .modal-card h3 { margin: 0 0 14px; color: var(--ink); font-weight: 590; letter-spacing: -0.01em; }
  .modal-card input { width: 100%; padding: 9px 11px; margin: 6px 0; background: var(--wash-0); border: 1px solid var(--line); color: var(--ink); border-radius: var(--r-sm); box-sizing: border-box; font: inherit; font-size: 13.5px; }
  .modal-card input:focus { outline: none; border-color: var(--accent-2); }
  .modal-card button { width: 100%; padding: 9px; margin-top: 6px; }
  .modal-card button[type="submit"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 510; }
  .modal-card button[type="submit"]:hover { background: var(--accent-hi); border-color: var(--accent-hi); }

  #authBar { margin-left: auto; display: flex; align-items: center; gap: 8px; }
  #authBar .who { color: var(--muted); font-size: 12px; padding: 0 4px; }

  /* account settings window */
  .acct-card { width: 380px; max-width: 92vw; }
  .acct-card .rb-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
  .acct-card .rb-modal-head button, .acct-card .acct-info button { width: auto; margin: 0; padding: 4px 10px; }
  .acct-info { display: flex; flex-direction: column; gap: 12px; padding: 12px 0 4px; border-bottom: 1px solid var(--line-soft); }
  .acct-info > div > .muted { font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; }
  .acct-info > div > div { font-size: 13.5px; color: var(--ink); margin-top: 2px; display: flex; align-items: center; gap: 8px; }

  .radar-wrap { display: flex; flex-direction: column; gap: 4px; }
  .radar-stage2 { position: relative; width: 100%; max-width: 460px; aspect-ratio: 1 / 1; margin: 4px auto 0; }
  .radar-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
  .rb { position: absolute; transform: translate(-50%,-50%); border-radius: 50%; border: 2px solid var(--dim); background: var(--panel); cursor: pointer; box-sizing: border-box; transition: transform 0.14s ease, opacity 0.14s ease; }
  .rb .rb-av { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
  .rb .rb-st { position: absolute; right: -1px; bottom: -1px; width: 34%; height: 34%; min-width: 9px; min-height: 9px; max-width: 13px; max-height: 13px; border-radius: 50%; border: 2px solid var(--panel); box-sizing: border-box; }
  .rb .rb-label { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 5px; font-size: 11px; color: var(--ink-2); white-space: nowrap; background: rgba(8,9,10,0.82); padding: 1px 6px; border-radius: var(--r-sm); pointer-events: none; }
  .rb:hover { transform: translate(-50%,-50%) scale(1.18); z-index: 20; }
  .rb.pulse { animation: rbPulse 1.7s ease-in-out infinite; }
  @keyframes rbPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(113,112,255,0); } 50% { box-shadow: 0 0 0 5px rgba(113,112,255,0.20); } }
  .radar-detail { margin-top: 12px; }
  .rb-card { display: flex; align-items: center; gap: 12px; background: var(--wash-0); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 10px 12px; }
  .rb-card-av { width: 44px; height: 44px; border-radius: var(--r); background: var(--panel); flex-shrink: 0; }
  .rb-card-name { font-weight: 590; color: var(--ink); }
  .rb-stats { display: flex; gap: 22px; margin-top: 10px; font-size: 13px; color: var(--muted); }
  .rb-stats b { color: var(--ink); font-weight: 590; font-size: 15px; display: block; }
  .rb-games { display: flex; flex-wrap: wrap; gap: 6px; }
  .rb-game { font-size: 12px; color: var(--ink-2); background: var(--wash-1); border: 1px solid var(--line); padding: 4px 10px; border-radius: var(--r-pill); cursor: pointer; }
  .rb-game:hover { background: var(--wash-2); color: var(--ink); }
  .radar-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
  .rb-modal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; width: min(94vw, 840px); max-height: 92vh; overflow: auto; box-shadow: rgba(0,0,0,0.5) 0 16px 50px; }
  .rb-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  /* sticky header inside the scrolling card: the title + ✕ stay pinned while you
     scroll, so the name is always readable and the window always closable */
  .rb-modal-card > .rb-modal-head { position: sticky; top: 0; z-index: 5; margin: 0; padding: 15px 22px; background: var(--surface); border-bottom: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: 0 6px 18px -12px rgba(0,0,0,0.6); }
  .rb-modal-card > .rb-modal-head .section-h { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rb-modal-card > .rb-modal-head > button { flex: 0 0 auto; }
  .rb-modal-body { padding: 18px 22px 22px; }
  .rb-modal-card .radar-stage2 { max-width: 700px; }
  /* .rb-aura retired: cluster is now the blip ring, status is the corner dot */
  .radar-clusters { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--muted); max-width: 460px; margin: 8px auto 0; }

  /* "How to read this" explainer */
  .radar-guide { max-width: 460px; margin: 12px auto 0; background: var(--wash-0); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 9px 13px; font-size: 12px; }
  .rb-modal-card .radar-guide { max-width: 700px; }
  .radar-guide > summary { cursor: pointer; font-weight: 590; color: var(--ink-2); list-style: none; user-select: none; }
  .radar-guide > summary::-webkit-details-marker { display: none; }
  .radar-guide > summary::before { content: "▾"; margin-right: 7px; color: var(--muted); font-size: 10px; }
  .radar-guide:not([open]) > summary::before { content: "▸"; }
  .rg-grid { margin-top: 9px; display: flex; flex-direction: column; gap: 7px; }
  .rg-row { display: flex; gap: 10px; align-items: baseline; }
  .rg-k { flex: 0 0 52px; color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: 0.04em; }
  .rg-v { flex: 1; min-width: 0; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .rg-st { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
  .rg-st .d, .rg-cl .d { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
  .rg-cl { display: inline-flex; align-items: center; gap: 6px; background: var(--wash-1); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 2px 10px; cursor: pointer; color: var(--ink-2); transition: background 0.12s ease, border-color 0.12s ease; }
  .rg-cl:hover { background: var(--wash-2); border-color: var(--line-strong); color: var(--ink); }
  .rg-hint { margin-top: 3px; font-size: 11.5px; line-height: 1.45; }

  /* Friend popover (opens on blip click, anchored inside the stage) */
  .rb-pop { position: absolute; z-index: 40; width: 250px; max-width: 82%; max-height: 90%; overflow: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: rgba(0,0,0,0.55) 0 14px 44px; padding: 13px 14px; animation: modalPop 0.16s cubic-bezier(0.2,0.9,0.3,1.15); }
  .rb-pop-x { position: absolute; top: 7px; right: 7px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; padding: 3px 6px; border-radius: var(--r-sm); }
  .rb-pop-x:hover { background: var(--wash-2); color: var(--ink); }
  .rb-pop-top { display: flex; gap: 11px; align-items: center; padding-right: 22px; }
  .rb-pop-av { width: 44px; height: 44px; border-radius: var(--r); background: var(--panel); flex-shrink: 0; object-fit: cover; }
  .rb-pop-name { font-weight: 590; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rb-pop-st, .rb-pop-cl { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: baseline; }
  .rb-pop-stats { display: flex; gap: 16px; margin: 11px 0; font-size: 11.5px; color: var(--muted); align-items: flex-end; }
  .rb-pop-stats b { color: var(--ink); font-size: 16px; display: block; font-weight: 590; line-height: 1.1; margin-bottom: 1px; }
  .rb-pop-grp { display: inline-flex; align-items: center; font-size: 12px; color: var(--ink-2); }
  .rb-pop-h { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 4px 0 7px; }
  .rb-pop-actions { margin-top: 11px; }
  .rb-pop-actions .btn { width: 100%; }
  .skel { background: linear-gradient(90deg, var(--wash-1) 25%, rgba(255,255,255,0.10) 50%, var(--wash-1) 75%); background-size: 200% 100%; animation: skel 1.3s ease-in-out infinite; display: inline-block; }
  @keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
  .rarity { display: inline-block; font-size: 10px; font-weight: 510; padding: 1px 7px; border-radius: var(--r-pill); border: 1px solid; }
  .rarity.r-common { color: #8a8f98; border-color: rgba(138,143,152,0.4); background: rgba(138,143,152,0.1); }
  .rarity.r-uncommon { color: #4ade80; border-color: rgba(74,222,128,0.4); background: rgba(74,222,128,0.1); }
  .rarity.r-rare { color: #7170ff; border-color: rgba(113,112,255,0.4); background: rgba(113,112,255,0.1); }
  .rarity.r-epic { color: #c084fc; border-color: rgba(192,132,252,0.4); background: rgba(192,132,252,0.1); }
  .rarity.r-legendary { color: #fbbf24; border-color: rgba(251,191,36,0.4); background: rgba(251,191,36,0.1); }
  .group-row { display: flex; flex-wrap: wrap; gap: 6px; }
  .group-chip { font-size: 12px; padding: 4px 10px; border-radius: var(--r-pill); background: var(--wash-1); border: 1px solid var(--line); color: var(--ink-2); }
  .group-chip:hover { background: var(--wash-2); color: var(--ink); }
  .cohort { display: grid; gap: 4px; margin-bottom: 8px; }
  .cohort-row { padding: 7px 9px; border-radius: var(--r-sm); font-size: 13px; }
  .cohort-row.clickable:hover { background: var(--wash-1); cursor: pointer; }
  .radar-stage2.focused .rb { opacity: 0.12; }
  .radar-stage2.focused .rb.sel, .radar-stage2.focused .rb.nb { opacity: 1; }
  .rb.sel { box-shadow: 0 0 0 3px rgba(113,112,255,0.55); z-index: 30; }
  .radar-stage2.focused .radar-edges line { stroke-opacity: 0.04; }
  .radar-stage2.focused .radar-edges line.sel { stroke-opacity: 0.6; }
  .radar-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
  .radar-adv { border-top: 1px solid var(--line-soft); padding-top: 8px; }
  .radar-filters .seg { display: inline-flex; background: var(--wash-1); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
  .radar-filters .seg button { background: none; border: 0; color: var(--muted); padding: 6px 11px; font: inherit; font-size: 12px; font-weight: 510; cursor: pointer; }
  .radar-filters .seg button:hover { color: var(--ink-2); }
  .radar-filters .seg button.on { background: var(--wash-2); color: var(--ink); }
  .radar-legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--muted); max-width: 440px; margin: 0 auto; }
  .radar-legend .sw { display: inline-flex; align-items: center; gap: 6px; }
  .radar-legend .d { width: 9px; height: 9px; border-radius: 50%; border: 2px solid; box-sizing: border-box; }
  .radar-table { width: 100%; font-size: 13px; margin-top: 4px; }

  @media (max-width: 640px) {
    header { flex-wrap: wrap; }
    header form { max-width: none; order: 3; flex-basis: 100%; }
    .tabs { flex-wrap: nowrap; overflow-x: auto; }
    .tab { white-space: nowrap; }
    .rb-label { display: none; }
    .radar-filters { gap: 6px; }
    .radar-filters .seg button { padding: 5px 8px; font-size: 11px; }
    .rb-modal-card > .rb-modal-head { padding: 12px 14px; }
    .rb-modal-body { padding: 14px; }
    /* bar charts: cap the label so the track keeps most of the width */
    .bar-label { width: 38%; min-width: 90px; font-size: 12px; }
    .bar-val { width: 56px; font-size: 11px; }
    .info-grid { grid-template-columns: 105px 1fr; }
    .profile-head { gap: 12px; flex-wrap: wrap; }
    .profile-head img.avatar { width: 56px; height: 56px; }
    .profile-head h2 { font-size: 18px; }
    .ph-actions { max-width: none; width: 100%; justify-content: flex-start; }
    .stat { margin-right: 18px; }
    .stat b { font-size: 18px; }
    .kpi .v { font-size: 17px; }
    #suggestBox { max-height: 50vh; }
    .app-hero { max-height: 170px; }
    /* wide tables scroll horizontally instead of overflowing the viewport */
    .wrap table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    /* orientation strip stacks; chips drop to their own line */
    .home-intro { align-items: flex-start; }
    .home-intro .hi-links { margin-left: 0; }
    /* modal takes the full screen for room */
    .modal { padding: 0; }
    .rb-modal-card { width: 100vw; max-width: 100vw; min-height: 100vh; max-height: 100vh; border-radius: 0; border: 0; }
    .rb-modal-card > .rb-modal-head { border-radius: 0; }
    /* auth controls wrap instead of overflowing */
    #authBar { flex-wrap: wrap; justify-content: flex-end; }
    .roulette-hero { padding: 16px; }
    .roulette-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  }
  @media (max-width: 400px) {
    .roulette-grid { grid-template-columns: 1fr; }
  }
  /* tablet: keep the wide wrap but trim padding */
  @media (max-width: 1024px) { .wrap { padding: 18px 14px 70px; } }
