/* XP competition (xp-ui.js): level badges, tier chips, the XP sheet, the
   Season tab and the Quest cleared / Level up moments. Theme tokens only:
   accent via --acc-*, the dark hero via --tile-dark. Tier colours are data. */
.xp-sheet svg, .xp-moment svg, #communityRoot .xp-season svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* level badge on avatars */
.xp-avw { position: relative; display: inline-flex; flex: none; }
.xp-lv { position: absolute; right: -5px; bottom: -4px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 999px; background: var(--n-hero); color: #fff; font-size: 9.5px; font-weight: 700; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--panel); font-variant-numeric: tabular-nums; }
.u-ins .xp-lv { box-shadow: 0 0 0 2px var(--u-tile); }
.cm-hero .xp-lv, .xp-hero .xp-lv { background: #fff; color: var(--n-ink); box-shadow: 0 0 0 2px var(--tile-dark); }
:root[data-theme="dark"] .xp-lv { background: #fff; color: #111214; }

/* tier chips */
.xp-tier { display: inline-flex; align-items: center; gap: 3px; flex: none; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.xp-light { background: var(--n-badge); color: #4b5058; }
.xp-solid { background: #dbeafe; color: #1e40af; }
.xp-hard { background: #ffedd5; color: #9a3412; }
.xp-epic { background: #f3e8ff; color: #6b21a8; }
:root[data-theme="dark"] .xp-light { background: #2a2d32; color: #c9ccd1; }
:root[data-theme="dark"] .xp-solid { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
:root[data-theme="dark"] .xp-hard { background: rgba(249, 115, 22, 0.2); color: #fdba74; }
:root[data-theme="dark"] .xp-epic { background: rgba(168, 85, 247, 0.22); color: #d8b4fe; }

/* the XP sheet */
.xp-sheet .ef-sec { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 2px 10px; }
.xp-lvrow { display: flex; align-items: center; gap: 14px; margin: 2px 2px 14px; }
.xp-avbig .fr-av { width: 56px; height: 56px; font-size: 18px; }
.xp-lvmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.xp-lvmain b { font-size: 16px; }
.xp-bar { display: block; height: 7px; border-radius: 999px; background: var(--u-seg); overflow: hidden; }
.xp-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.xp-bar.is-dark { background: rgba(255, 255, 255, 0.12); }
.xp-hero { background: var(--tile-dark); color: #fff; border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
:root[data-theme="dark"] .xp-hero { background: #202328; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.xp-hero-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.xp-big { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.xp-big small { font-size: 13px; font-weight: 600; color: #a7acb4; letter-spacing: 0; }
.xp-rank { font-size: 12px; font-weight: 700; color: var(--acc-300); }
.xp-stack { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; }
.xp-stack .e, .xp-keys i.e { background: var(--accent); }
.xp-stack .d, .xp-keys i.d { background: var(--acc-300); }
.xp-stack .q, .xp-keys i.q { background: #fb923c; }
.xp-stack .z { background: rgba(255, 255, 255, 0.1); }
.xp-keys { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; font-weight: 600; color: #d4d7dc; }
.xp-keys span { display: inline-flex; align-items: center; gap: 5px; }
.xp-keys i { width: 8px; height: 8px; border-radius: 50%; }
.xp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.xp-stats span { background: var(--u-tile); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.xp-stats small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.xp-stats b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.xp-rows .u-row { gap: 10px; }
.xp-rows .u-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.xp-rows .u-val { white-space: nowrap; text-align: right; }
.xp-rows .u-val small { font-size: 11px; font-weight: 500; color: var(--muted); }
.xp-ico { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--panel); color: var(--muted); }
.xp-ico svg { width: 16px; height: 16px; }
.xp-ico.is-q { color: #c2410c; }
.xp-main { background: var(--tile-dark); color: #fff; border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.xp-main b { font-size: 16px; }
.xp-main > span:last-child { font-size: 11.5px; color: #a7acb4; font-weight: 500; }
.xp-vrow { flex-wrap: wrap; }
.xp-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.xp-note { margin: 14px 2px 0; line-height: 1.45; }
button.u-row.xp-srow { width: 100%; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; background: none; }

/* Season tab */
.xp-season { background: var(--tile-dark); color: #fff; border-radius: 22px; padding: 16px 16px 0; overflow: hidden; }
:root[data-theme="dark"] .xp-season { background: #202328; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.xp-season-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.xp-season-when { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.xp-season-when b { font-size: 13px; font-weight: 700; }
.xp-season-when small { font-size: 11px; font-weight: 500; color: #a7acb4; margin-top: 2px; }
.xp-weeks { display: flex; gap: 4px; margin-top: 12px; }
.xp-weeks i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); }
.xp-weeks i.done { background: var(--accent); }
.xp-weeks i.now { background: linear-gradient(90deg, var(--accent) 50%, rgba(255, 255, 255, 0.12) 50%); }
.xp-season-tip { margin: 4px -16px 0; padding: 0 16px 16px; background: #24272b; }
.xp-season-tip .cm-tip { margin-top: 0; padding-top: 12px; background: none; padding-left: 0; padding-right: 0; }
#communityRoot .xp-season-tip .cm-tip svg { stroke-width: 2.2; }
.xp-podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin-top: 12px; }
.xp-pod { width: 30%; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.xp-podav { border: 0; background: none; padding: 0; cursor: pointer; }
.xp-pod .fr-av { width: 44px; height: 44px; font-size: 15px; }
.xp-pod.p1 .fr-av { width: 52px; height: 52px; box-shadow: 0 0 0 3px var(--accent); }
.xp-podn { font-size: 12.5px; font-weight: 600; }
.xp-podx { font-size: 12px; font-weight: 700; color: #a7acb4; font-variant-numeric: tabular-nums; }
.xp-pod.p1 .xp-podx { color: var(--acc-300); }
.xp-podb { width: 100%; display: flex; justify-content: center; padding-top: 8px; box-sizing: border-box; border-radius: 12px 12px 0 0; background: #24272b; font-size: 18px; font-weight: 700; color: #d4d7dc; height: 50px; }
.xp-pod.p1 .xp-podb { height: 80px; background: var(--accent); color: var(--acc-deep); font-size: 20px; }
.xp-pod.p3 .xp-podb { height: 38px; }
.xp-dots { display: flex; gap: 4px; flex: none; }
.xp-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--u-seg); }
.xp-dots i.won { background: var(--accent); }
.xp-dots i.todo { background: none; box-shadow: inset 0 0 0 1.5px var(--n-line); }
.xp-dots i.now { background: none; box-shadow: inset 0 0 0 1.5px var(--accent); }
.xp-sright { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.xp-rows .xp-split { background: var(--u-seg); margin-top: 5px; }
.xp-keys-light { color: var(--muted); font-size: 11px; font-weight: 500; margin: 8px 4px 0; }
.xp-keys-light i { border-radius: 2px; }
.xp-keys-light i.q { background: #fb923c; }
.xp-qname { display: flex; align-items: center; gap: 6px; min-width: 0; }
.xp-qname .u-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-qbar { display: block; height: 5px; border-radius: 3px; background: var(--u-seg); overflow: hidden; margin-top: 5px; }
.xp-qbar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.xp-qav .fr-av { width: 30px; height: 30px; font-size: 10.5px; }
.xp-plus { color: var(--acc-700); }
:root[data-theme="dark"] .xp-plus { color: var(--acc-400); }
.xp-none { margin: 4px 4px 0; }
.xp-srow.is-me { background: rgba(var(--acc-500-rgb), 0.08); }

/* moments */
.xp-moment { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; opacity: 0; transition: opacity .22s ease; }
.xp-moment.in { opacity: 1; }
.xp-moment.still { transition: none; }
.xp-moment.is-dark { background: var(--n-hero); color: #fff; }
.xp-moment.is-card { background: rgba(10, 11, 13, 0.55); }
.xp-kick { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--acc-300); }
.xp-cleared { width: 100%; max-width: 390px; height: 100%; max-height: 780px; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 24px; text-align: center; }
.xp-mring .dash { stroke: #2a2d32; }
.xp-mring .trk { stroke: #24272b; }
.xp-mring .arc { stroke: var(--accent); }
.xp-mring .face { fill: #1f2226; }
.xp-mring .tick { stroke: var(--acc-400); }
.xp-moment.in .xp-mring { animation: xp-pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.xp-moment.in .xp-mring .arc { animation: xp-draw .9s ease-out both; }
.xp-moment.still .xp-mring, .xp-moment.still .xp-mring .arc { animation: none; }
@keyframes xp-pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes xp-draw { from { stroke-dasharray: 0 478; } }
.xp-mtitle { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.xp-mwhy { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; font-size: 12.5px; font-weight: 600; color: #b5b9c0; }
.xp-mxp { font-size: 46px; font-weight: 700; color: var(--acc-400); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.xp-mcard { width: 100%; box-sizing: border-box; background: #1f2226; border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; text-align: left; border: 0; font: inherit; color: #fff; }
.xp-mrow { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.xp-mrow span:last-child { color: #b5b9c0; }
.xp-mbar { display: flex; height: 10px; border-radius: 5px; background: #2c3036; overflow: hidden; }
.xp-mbar .was { background: var(--accent); }
.xp-mbar .new { background: var(--acc-300); }
.xp-msub { font-size: 12px; font-weight: 500; color: #b5b9c0; }
.xp-mrank { flex-direction: row; align-items: center; gap: 12px; cursor: pointer; }
.xp-mrank b { display: block; font-size: 13px; }
.xp-mrank small { font-size: 12px; color: #b5b9c0; font-weight: 500; }
.xp-mup { width: 32px; height: 32px; border-radius: 50%; background: #2c3036; display: grid; place-items: center; color: var(--acc-400); flex: none; }
.xp-mup svg { width: 16px; height: 16px; stroke-width: 2.4; }
.xp-mgap { flex: 1; }
.xp-mdone { width: 100%; justify-content: center; }
.xp-lvcard { width: 100%; max-width: 350px; background: var(--panel); color: var(--text); border-radius: 28px; padding: 26px 20px 20px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3); }
.xp-moment.in .xp-lvcard { animation: xp-pop .45s cubic-bezier(.2, 1.3, .4, 1) both; }
.xp-moment.still .xp-lvcard { animation: none; }
.xp-lvring { position: relative; width: 132px; height: 132px; }
.xp-lvring .halo { fill: var(--acc-100); }
.xp-lvring .trk { stroke: var(--acc-200); }
.xp-lvring .arc { stroke: var(--accent); }
.xp-lvring .face { fill: var(--n-hero); }
.xp-lvring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; font-weight: 700; color: #fff; }
.xp-lvcard .xp-kick { color: var(--acc-700); }
.xp-lvt { font-size: 24px; font-weight: 700; }
.xp-lvcard .xp-rows { width: 100%; text-align: left; }
.xp-lvcard p { margin: 0; }
:root[data-theme="dark"] .xp-lvcard .xp-kick { color: var(--acc-300); }
:root[data-theme="dark"] .xp-lvring .halo { fill: rgba(var(--acc-500-rgb), 0.16); }
:root[data-theme="dark"] .xp-lvring .trk { stroke: rgba(var(--acc-500-rgb), 0.3); }

/* pin preview (quests-ui.js) */
.xp-preview { background: var(--tile-dark); color: #fff; border-radius: 20px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
:root[data-theme="dark"] .xp-preview { background: #202328; }
.xp-pv-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.xp-pv-top > span:first-child { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #a7acb4; }
.xp-pv-xp { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }
.xp-pv-xp small { font-size: 13px; font-weight: 600; color: #a7acb4; }
.xp-scale { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
.xp-scale i { height: 8px; background: #3a3d42; }
.xp-scale i:first-child { border-radius: 4px 0 0 4px; }
.xp-scale i:last-child { border-radius: 0 4px 4px 0; }
.xp-scale i.on.light { background: #9aa0a8; }
.xp-scale i.on.solid { background: #60a5fa; }
.xp-scale i.on.hard { background: #fb923c; }
.xp-scale i.on.epic { background: #c084fc; }
.xp-scale-l { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); font-size: 10.5px; font-weight: 600; color: #8f949c; }
.xp-scale-l span.on { color: #fff; }
.xp-pv-why { font-size: 12.5px; font-weight: 500; color: #d4d7dc; line-height: 1.45; }
.xp-pv-why b { color: #fff; }
.qs-tierline { display: flex; align-items: center; gap: 8px; margin: 10px 2px 0; font-size: 12px; color: var(--muted); font-weight: 500; line-height: 1.4; }

/* Community pieces (friends-ui.js) */
.cm-hero-btn { display: block; width: 100%; border: 0; text-align: left; font: inherit; cursor: pointer; }
.cm-hero-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cm-hrow { grid-template-columns: 14px 30px minmax(0, 72px) 1fr auto; }
button.u-row.fr-brow { width: 100%; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; background: none; }
button.u-row.fr-brow.is-me { background: rgba(var(--acc-500-rgb), 0.08); }
.fr-card-subrow { display: flex; justify-content: space-between; gap: 8px; }
.cm-lvico { font-size: 14px; font-weight: 700; color: var(--acc-700); }
:root[data-theme="dark"] .cm-lvico { color: var(--acc-300); }
.cm-quest .xp-tier { margin-left: auto; }
.cm-fopen { border: 0; background: none; padding: 0; cursor: pointer; display: inline-flex; }
.cm-nglyph.is-warn { background: #f97316; }
.cm-nav .xp-lv { display: none; }

/* Quests pieces (quests-ui.js) */
button.qs-level { width: 100%; border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.qs-lvl-main { display: flex; flex-direction: column; gap: 4px; }
.qs-kickrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qs-row .u-meta .xp-tier { margin-right: 4px; vertical-align: 1px; }
.qs-vouch { margin-top: 10px; }
.xp-mring .face, .xp-lvring .halo, .xp-lvring .face { stroke: none; }
