/* Potato Points (points.html, js/points.js), 2026-10-06 rework on the design system (docs/design-system.md): tokens,
   .card, .pill, .stat, .seg, .disclosure, .check, .skeleton and the page mark come from styles.css; this file only
   composes them. Order on the page: header with the programme's state → one leading panel (Connect X, or your
   dashboard) → tasks → campaign on X → your invites → rewards → leaderboard → how it works.
   Motion is feedback only (press, expand, progress, one success moment via PotatchiUI.celebrate, rank changes that
   glide); no loops, no shimmer. Reduced motion: nothing moves, nothing is lost. Loaded after styles.css, before
   points-season.css (the Season 1 blocks). */

.points {
  display: flex;
  flex-direction: column;
  gap: clamp(36px, 6vw, 56px);
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(16px, 3.5vw, 40px) max(var(--gutter), env(safe-area-inset-right)) clamp(56px, 9vw, 96px) max(var(--gutter), env(safe-area-inset-left));
}
.points > * { min-width: 0; }
.points h2 { font-size: var(--step-2); line-height: 1.15; }
.points h3 { font-size: var(--text-lg); line-height: 1.25; }
.points h1, .points h2, .points h3, .points p { text-wrap: pretty; }
.points a:not(.btn) { color: var(--ink); text-underline-offset: 3px; text-decoration-color: rgba(51, 37, 22, .35); }
.points a:not(.btn):hover { text-decoration-color: currentColor; }
.pts-muted { color: var(--ink-2); }
.pts-small { font-size: var(--text-sm); line-height: 1.5; }
.pts-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.points .btn { min-height: 44px; }                                 /* every touch target ≥ 44 px, small sizes included */
.points .btn--tiny { min-height: 44px; padding: 8px 16px; font-size: var(--text-sm); }
.points .icon { flex: none; }
.pts-label { display: block; font-size: var(--text-sm); font-weight: 700; color: var(--ink-2); }
.pts-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.pts-section-head__note { font-size: var(--text-sm); color: var(--ink-3); }
.pts-section-head + * { margin-top: var(--space-4); }

/* ------------------------------------------------------------------ header -- */
/* one column: page mark + title, the line under it, the programme's state (styles.css → page header) */
.points .page-head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "lede" "meta"; row-gap: 12px; }
.pts-head__title { display: flex; align-items: center; gap: clamp(12px, 2vw, 18px); }
.pts-head__title .page-mark { width: clamp(46px, 5vw, 56px); height: clamp(46px, 5vw, 56px); border-radius: clamp(14px, 1.6vw, 18px); }
/* the line under the title changes with what is switched on: one line of room on wide screens, two on phones */
.points .page-head__lede { max-width: 44em; }
@media (min-width: 900px) { .points .page-head__lede { min-height: 1.32em; } }
/* the state: a pill and one sentence, flowing as text (two lines of room on phones, one on wide screens) */
.pts-program { display: block; min-height: 1.9em; font-size: var(--text-sm); line-height: 1.9; color: var(--ink-2); }
/* the pill sits inside the first line's box (never taller than it), so the row is exactly one or two lines high */
.pts-program .pill { display: inline-flex; min-height: 0; height: 1.75em; margin-right: 8px; padding-block: 0; vertical-align: top; margin-top: .075em; line-height: 1; }
.pts-program .pill .icon { width: 14px; height: 14px; }
@media (max-width: 899px) { .pts-program { min-height: calc(2 * 1.9em); } }

/* the header sits a little closer to the panel it introduces */
.points > .page-head { margin-bottom: calc(-1 * clamp(8px, 2vw, 20px)); }

/* development preview (a dev Worker only; never in the production HTML: points.js adds it) */
.pts-devnote { padding: 10px 14px; border-radius: var(--radius-md); border: 1.5px dashed var(--gold); background: repeating-linear-gradient(45deg, rgba(217, 160, 82, .09) 0 10px, transparent 10px 20px); font-size: var(--text-sm); }

/* messages about what just happened (back from X, an invite link, a failed action) */
.pts-banner { padding: 12px 16px; border-radius: var(--radius-md); background: var(--info-bg); border: 1px solid var(--info-line); color: var(--ink); font-size: 1rem; line-height: 1.5; }
.pts-banner--ok { background: var(--ok-bg); border-color: var(--ok-line); }
.pts-banner--error { background: var(--bad-bg); border-color: var(--bad-line); }
.pts-banner--choose { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pts-confirm__av { width: 40px; height: 40px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--gold); }
.pts-confirm__text { flex: 1 1 14em; min-width: 0; }

/* ------------------------------------------------------------ anti-shift -- */
/* Until Points first answers, nothing under the panel shows: the blocks below appear together with the answer, so
   nothing the visitor already sees moves (a dashboard is taller than the loading panel, and the campaign, rewards
   and invites exist only in the answer). The margin keeps the footer below the fold meanwhile. With a message due
   at the top (back from X, an invite link: html.pts-hold, set in the page's head), the panel waits for it too.
   No answer within 8 seconds (.is-slow): everything shows in its "Checking" state. */
.js .points:not([data-profile]):not(.is-slow) #pts-panel ~ * { display: none; }
.js .points:not([data-profile]):not(.is-slow) #pts-panel { margin-bottom: 100vh; }
.js.pts-hold .points:not([data-profile]):not(.is-slow) #pts-banner,
.js.pts-hold .points:not([data-profile]):not(.is-slow) #pts-panel { visibility: hidden; }

/* without scripts there is nothing to check or list: say so (the <noscript> notes) instead of showing placeholders */
html:not(.js) .pts-program, html:not(.js) #tasks, html:not(.js) .pts-views, html:not(.js) .pts-rule, html:not(.js) .pts-featured, html:not(.js) .pts-rows,
html:not(.js) .pts-panel__loading { display: none; }

/* -------------------------------------------------------------- the panel -- */
.pts-panel { padding: clamp(18px, 3.4vw, 32px); border-radius: var(--radius-lg); }
.pts-panel__title { font-size: var(--step-2); line-height: 1.15; overflow-wrap: anywhere; }
.pts-panel__live > * + * { margin-top: var(--space-4); }
.pts-panel[data-panel="loading"] .pts-panel__live { min-height: 132px; }

/* closed, napping */
.pts-closed { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; align-items: start; }
.pts-closed > .page-mark { width: 48px; height: 48px; border-radius: var(--radius-md); }
.pts-closed > .page-mark .icon { width: 24px; height: 24px; }
.pts-closed__body > * + * { margin-top: 8px; }
.pts-closed__body p { max-width: 62ch; color: var(--ink-2); }
.pts-closed__actions { margin-top: 16px !important; }

/* signed out: what you get on the left; the consent and Connect X on the right (stacked on phones) */
.pts-join { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 20px clamp(24px, 5vw, 56px); align-items: center; }
.pts-join__info > * + * { margin-top: var(--space-4); }
.pts-join__intro > * + * { margin-top: 6px; }
.pts-join__lead { font-size: var(--text-lg); color: var(--ink-2); max-width: 44ch; }
.pts-join__lead strong { color: var(--ink); font-family: var(--font-display); font-weight: 600; }
.pts-join__preview { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--ink-2); }
.pts-join__fine { display: flex; gap: 12px; align-items: flex-start; max-width: 54ch; font-size: var(--text-sm); line-height: 1.5; color: var(--ink-2); }
.pts-join__fine .icon { width: 20px; height: 20px; margin-top: 1px; color: var(--gold-ink); }
.pts-join__act > * + * { margin-top: var(--space-3); }

/* the consent and the one Connect X button (also used for "Switch account" and "Reconnect X") */
.pts-connect { display: grid; gap: 12px; }
.pts-connect__check { padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: var(--radius-md); background: var(--surface-1); font-size: var(--text-md); color: var(--ink); }
.pts-connect__check:has(input:checked) { border-color: var(--ink); background: var(--surface-2); }
.pts-connect__check:has(input:focus-visible) { box-shadow: var(--ring); }
.pts-connect__check input:focus-visible { outline: none; }
.pts-connect__btn { width: 100%; }
.pts-connect__why { min-height: 1.5em; font-size: var(--text-sm); line-height: 1.5; color: var(--ink-3); }
.pts-connect__why.is-attention { color: var(--warn); font-weight: 700; }
.pts-connect--compact .pts-connect__btn { width: auto; justify-self: start; }
.pts-tolink { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.pts-inapp { display: grid; gap: 12px; justify-items: start; font-size: var(--text-sm); line-height: 1.5; color: var(--ink); }
.pts-invite-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: var(--text-md); }
.pts-invite-note > .icon { color: var(--gold-ink); }
.pts-invite-note > span { flex: 1 1 16em; min-width: 0; }

/* signed in: your dashboard */
.pts-panel[data-panel="me"] .pts-panel__live { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.pts-panel[data-panel="me"] .pts-panel__live > * { margin: 0; }
.pts-panel[data-panel="me"] .pts-panel__live > .pts-news,
.pts-panel[data-panel="me"] .pts-panel__live > .pts-dash__who,
.pts-panel[data-panel="me"] .pts-panel__live > .pts-dash__foot { grid-column: 1 / -1; }
.pts-dash__stats, .pts-dash__tiles { grid-column: span 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin: 0; }
.pts-dash__who { display: flex; align-items: center; gap: 16px; min-width: 0; }
.pts-dash__ring { flex: none; padding: 3px; border-radius: 50%; background: linear-gradient(145deg, #FBE3A8, var(--gold) 55%, #B27A26); }
.pts-dash__av { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--surface-1); object-fit: cover; font-size: var(--text-2xl); }
.pts-who { min-width: 0; }
.pts-who__handle { margin-top: 2px; font-size: var(--text-sm); color: var(--ink-3); overflow-wrap: anywhere; }
.pts-dash__stats dd, .pts-invite__stats dd { margin: 0; }
.pts-dash__stats .stat, .pts-tile { padding: 14px 16px; border-radius: var(--radius-md); background: var(--surface-2); min-width: 0; }
.pts-dash__stats .stat__label, .pts-tile__eyebrow { font-family: var(--font-mono); font-size: var(--text-2xs); font-weight: 400; color: var(--gold-ink); }
.pts-dash__stats .stat__value { font-size: var(--step-3); line-height: 1.1; }
/* your balance is the one number on the page that is yours: bigger, gold, on its own tile */
.pts-dash__stats [data-balance-stat] { background: var(--gold-soft); border: 1px solid #E7C98F; }
.pts-dash__stats [data-balance-stat] .stat__value { font-size: var(--step-3x); color: var(--gold-deep); }
.pts-dash__stats .stat__note { font-size: var(--text-sm); line-height: 1.4; color: var(--ink-3); }
.pts-dash__points .stat__value { color: var(--ink); }
.pts-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.pts-tile__title { font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
.pts-tile__row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pts-tile__art { width: 36px; height: 36px; object-fit: contain; flex: none; }
.pts-tile__meta { font-size: var(--text-sm); color: var(--ink-2); }
.pts-tile__note { font-size: var(--text-sm); line-height: 1.45; color: var(--ink-3); }
.pts-tile__btn { margin-top: auto; }
.pts-tile--task .pts-tile__btn { margin-top: 4px; }
.pts-meter { position: relative; display: block; width: 100%; height: 8px; margin-top: 4px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; }
.pts-meter__fill { position: absolute; inset: 0; border-radius: inherit; background: var(--gold); transform-origin: left center; }
.pts-dash__foot { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; padding-top: var(--space-4); border-top: 1px solid var(--line); }
.pts-dash__foot > [data-share-open] { flex: none; }
.pts-account { flex: 1 1 320px; border: 0; background: transparent; }
.pts-account > summary { min-height: 44px; padding: 8px 4px; font-family: var(--font-body); font-size: 1rem; font-weight: 700; }
.pts-account > summary .icon { color: var(--gold-ink); }
.pts-account .disclosure__body { padding: 4px 4px 8px; }
.pts-account .disclosure__body > * + * { margin-top: 16px; }
.pts-account__h { font-size: 1rem !important; }
.pts-done { display: grid; gap: 8px; }
.pts-done li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: var(--text-md); }
.pts-done__title { font-weight: 700; }
.pts-done__meta { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-2); white-space: nowrap; }
.pts-public { min-height: 44px; align-items: center; font-size: 1rem; color: var(--ink); }
.pts-save { min-height: 1.4em; margin-top: 4px !important; font-size: var(--text-sm); color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.pts-save.is-saved { color: var(--ok); font-weight: 700; }
.pts-save.is-error { color: var(--bad); font-weight: 700; }
.pts-save:empty { min-height: 0; margin: 0 !important; }
.pts-danger { color: var(--bad); }
.pts-switch > * + * { margin-top: 12px; }
.pts-confirm-del { background: var(--bad-bg); border: 1px solid var(--bad-line); }
.pts-confirm-del > * + * { margin-top: 12px; }

/* news at the top of your dashboard: what the server just confirmed */
.pts-news { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 10px 14px; border-radius: var(--radius-md); background: var(--ok-bg); border: 1px solid var(--ok-line); }
.pts-news__art { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 2px solid var(--gold); background: var(--bg); object-fit: cover; }
.pts-news__text { flex: 1 1 14em; min-width: 0; font-size: 1rem; }
.pts-news__text strong { font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); }
.pts-news__unlock { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: var(--radius-pill); background: var(--surface-1); border: 1px solid #E7C98F; font-size: var(--text-sm); font-weight: 700; }
.pts-news__unlock img { width: 28px; height: 28px; object-fit: contain; }

/* ------------------------------------------------------------------- tasks -- */
/* compact cards, two across on wide screens; a card that opens a panel (quest, puzzle, form) takes the full row */
.pts-task-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: var(--space-4); margin: 0; padding: 0; list-style: none; }
.pts-task { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 14px; align-content: start; padding: clamp(16px, 2.4vw, 20px); background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--elev-1); transition: border-color var(--dur-2) var(--ease-out); }
.pts-task:has(.pts-quest:not([hidden])), .pts-task:has(.pts-puzzle:not([hidden])), .pts-task:has(.pts-form:not([hidden])),
.pts-task:has([data-create-consent]:not([hidden])), .pts-task:has([data-create-x]:not([hidden])), #task-pfp { grid-column: 1 / -1; }
.pts-task__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--surface-2); color: var(--gold-ink); }
.pts-task__icon .icon { width: 22px; height: 22px; }
.pts-task__icon--brand { background: var(--ink); color: var(--surface-1); }
.pts-task__icon--brand .icon { width: 20px; height: 20px; }
.pts-task__main { min-width: 0; }
.pts-task__main > * + * { margin-top: 12px; }
.pts-task__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 12px; }
.pts-task__title { flex: 1 1 auto; min-width: 0; padding-top: 2px; font-size: var(--text-lg); }
.pts-task__title:focus { outline: none; }
.pts-task__title:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: var(--radius-sm); }
.pts-worth { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px 3px 8px; border-radius: var(--radius-pill); background: var(--gold-soft); border: 1px solid #E7C98F; color: var(--gold-ink); font-family: var(--font-display); font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pts-worth .icon { width: 16px; height: 16px; }
.pts-task__desc { margin-top: 4px !important; font-size: var(--text-md); line-height: 1.5; color: var(--ink-2); }
.pts-task__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 14px; }
.pts-task__state { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 28px; }
.pts-task__note { font-size: var(--text-sm); line-height: 1.45; color: var(--ink-2); }
.pts-task__action { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pts-task[data-kind="available"] { border-color: #E7C98F; }
.pts-task[data-kind="completed"] { border-color: var(--ok-line); }
.pts-task[data-kind="completed"] .pts-worth { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.pts-task[data-kind="not_completed"] { border-color: var(--warn-line); }
.pts-task[data-kind="unavailable"] { border-color: var(--bad-line); }
.pts-task[data-kind="locked"] .pts-worth { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.pts-steps { display: grid; gap: 8px; margin: 0; padding-left: 1.3em; list-style: decimal; font-size: var(--text-md); line-height: 1.5; color: var(--ink-2); }
.pts-steps a { font-weight: 700; }
.pts-consent > * + * { margin-top: 12px; }
.pts-state { min-height: 1.5em; font-weight: 700; font-size: 1rem; }
.pts-state--ok { color: var(--ok); }
.pts-state--warn { color: var(--bad); }
.pts-state:empty { display: none; }

/* the PFP post on X (off; kept working for when X allows it) */
.pts-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; counter-reset: flow; list-style: none; padding: 0; }
.pts-flow li { counter-increment: flow; padding: 8px 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); text-align: center; font-family: var(--font-display); font-size: var(--text-md); color: var(--ink-2); }
.pts-flow li::before { content: counter(flow) '. '; }
.pts-flow li.is-current { border-color: var(--ink); color: var(--ink); background: var(--surface-2); }
.pts-flow li.is-done { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }
.pts-pane > * + * { margin-top: 12px; }
.pts-verify { display: grid; grid-template-columns: 1fr auto; gap: 12px; }

/* ------------------------------------------------------------- leaderboard -- */
.pts-views { margin-top: var(--space-4); }
.points .seg > button { min-height: 44px; padding: 8px 20px; font-size: var(--text-md); }
.pts-rule { margin-top: 12px; max-width: 72ch; font-size: var(--text-sm); line-height: 1.5; color: var(--ink-3); }
.pts-featured { margin-top: var(--space-4); }
.pts-featured:empty { display: none; }
img.pts-row__av, img.pts-leader__av, img.pts-joint__av, img.pts-dash__av { background: var(--surface-3); }     /* while X's picture loads */
.pts-av--mono { background: var(--tone, #F4DDA8); color: #4A3016; font-family: var(--font-display); font-weight: 600; line-height: 1; }
.pts-you { display: inline-block; flex: none; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--ink); color: var(--surface-1); font-family: var(--font-mono); font-size: var(--text-2xs); }

/* first place: one prominent card (the crown, the picture, the handle, the points) */
.pts-leader { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 12px clamp(12px, 2vw, 20px); min-height: 116px; padding: 16px clamp(16px, 2.6vw, 24px);
  border-radius: var(--radius-lg); background: var(--gold-soft); border: 1px solid #E7C98F; box-shadow: var(--elev-2); }
.pts-leader.is-me { box-shadow: var(--elev-2), inset 0 0 0 2px var(--gold); }
/* first place (2026-10-26): a gold edge and one slow sheen across the card; nothing moves for reduced motion */
.pts-leader { position: relative; overflow: hidden; border-color: #E0B86A; box-shadow: var(--elev-2), inset 0 1px 0 rgba(255, 255, 255, .7); }
.pts-leader::after { display: none; }
@keyframes pts-sheen { 0%, 22% { left: -30%; } 42%, 100% { left: 120%; } }
.pts-leader__crown { background: linear-gradient(160deg, #FBE3A8, var(--gold) 60%, #C98A2E); box-shadow: var(--elev-1), inset 0 1px 0 rgba(255, 255, 255, .6); }
.pts-leader__place::before { content: '★ '; color: var(--gold); }
/* second and third: a small medal chip on the rank, silver and bronze */
.pts-row--silver .pts-row__rank, .pts-row--bronze .pts-row__rank { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 4px; border-radius: var(--radius-pill); }
.pts-row--silver .pts-row__rank { background: #EEF1F4; color: #4D5664; }
.pts-row--bronze .pts-row__rank { background: #F6E6DA; color: #7A4520; }
@media (prefers-reduced-motion: reduce) { .pts-leader::after { display: none; } }
.pts-leader__crown { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--gold); color: #2A1C0C; box-shadow: var(--elev-1); }
.pts-leader__crown .icon { width: 24px; height: 24px; stroke-width: 2; }
.pts-leader__ring { display: inline-grid; padding: 3px; border-radius: 50%; background: linear-gradient(145deg, #FBE3A8, var(--gold) 55%, #B27A26); }
.pts-leader__av { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--surface-1); object-fit: cover; font-size: var(--step-2); }
.pts-leader__body { min-width: 0; }
.pts-leader__place { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--gold-ink); }
.pts-leader__who, .pts-row__who, .pts-joint__who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.pts-leader__who-handle { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-size: var(--step-2); font-weight: 600; color: var(--ink) !important; text-decoration: none; }
.pts-leader__who-handle:hover { text-decoration: underline; }
.pts-leader__pts { text-align: right; font-family: var(--font-display); white-space: nowrap; }
.pts-leader__n { font-size: var(--step-3); font-weight: 600; color: var(--ink); }
.pts-leader__unit { font-family: var(--font-body); font-size: var(--text-sm); color: var(--ink-2); }

/* joint leaders: everyone sharing first place gets the same card, never split */
.pts-joint { padding: clamp(16px, 2.6vw, 24px); border-radius: var(--radius-lg); background: var(--gold-soft); border: 1px solid #E7C98F; box-shadow: var(--elev-2); }
.pts-joint__head { display: flex; align-items: center; gap: 16px; }
.pts-joint__head h3 { font-size: var(--step-2); }
.pts-joint__head p { font-size: var(--text-sm); }
.pts-joint__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 12px; margin: 14px 0 0; padding: 0; list-style: none; }
.pts-joint__card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-1); border: 1px solid #EFD9A9; }
.pts-joint__card.is-me { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.pts-joint__ring { display: inline-grid; flex: none; padding: 2px; border-radius: 50%; background: var(--gold); }
.pts-joint__av { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--surface-1); object-fit: cover; font-size: var(--text-xl); }
.pts-joint__text { min-width: 0; }
.pts-joint__place { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--gold-ink); }
.pts-joint__who-handle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--ink) !important; text-decoration: none; }
.pts-joint__more { margin-top: 12px; }

/* the list */
.pts-rows { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.pts-row { display: grid; grid-template-columns: minmax(3.4rem, max-content) 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 58px; padding: 8px 16px; border-radius: var(--radius-md); background: var(--surface-1); border: 1px solid var(--line); }
.pts-row.is-me { background: var(--gold-soft); border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.pts-row__rank { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--ink-2); white-space: nowrap; }
.pts-row__medal { width: 18px; height: 18px; stroke-width: 2; }
.pts-row--silver { border-left: 4px solid #A9B1BC; }
.pts-row--silver .pts-row__medal { color: #6F7885; }
.pts-row--bronze { border-left: 4px solid #C98A5E; }
.pts-row--bronze .pts-row__medal { color: #9A5A2C; }
.pts-row__av { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; font-size: 1rem; }
.pts-row__who-handle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--ink) !important; text-decoration: none; }
.pts-row__who-handle:hover { text-decoration: underline; }
.pts-row__pts { font-family: var(--font-display); font-weight: 600; white-space: nowrap; }
.pts-row__unit { font-family: var(--font-body); font-size: var(--text-xs); font-weight: 500; color: var(--ink-3); }
.pts-me { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; padding: 10px 12px 10px 16px; border-radius: var(--radius-md); background: var(--gold-soft); border: 1px solid #E7C98F; font-weight: 700; }
.pts-me > .icon { color: var(--gold-ink); }
.pts-me__text { flex: 1 1 14em; min-width: 0; }
.pts-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.pts-pager__page { font-size: var(--text-sm); color: var(--ink-2); text-align: center; }
.pts-board.is-refreshing .pts-featured, .pts-board.is-refreshing .pts-rows { opacity: .6; transition: opacity var(--dur-2) var(--ease-out); }

/* loading (the skeleton keeps the exact room: a leader card and four rows), empty, error */
.pts-leader--skel { background: var(--surface-1); border-color: var(--line); box-shadow: none; grid-template-columns: auto minmax(0, 1fr) auto; }
.pts-skel-av { width: 78px; height: 78px; min-width: 0; border-radius: 50%; }
.pts-skel-lines { display: grid; gap: 8px; justify-items: start; }
.pts-skel-num { font-size: var(--step-2); }
.pts-row--skel { border-style: dashed; }
.pts-row--skel .skeleton { justify-self: start; }
.pts-skel-dot { width: 40px; height: 40px; min-width: 0; border-radius: 50%; }
.pts-empty { display: grid; justify-items: center; gap: 8px; padding: clamp(20px, 4vw, 32px) 18px; text-align: center; border-radius: var(--radius-lg); background: var(--surface-1); border: 1px dashed var(--line-2); }
.pts-empty__art { width: 120px; height: auto; }
.pts-empty p { max-width: 44ch; }
.pts-board-error { display: grid; justify-items: start; gap: 12px; background: var(--bad-bg); border: 1px solid var(--bad-line); }
.pts-board-error h3 { font-size: var(--text-lg); }

/* ------------------------------------------------------------ how it works -- */
.pts-about__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-4); align-items: start; }
.pts-about__list .disclosure + .disclosure { margin-top: 0; }
.pts-about__list .disclosure__body > * + * { margin-top: 12px; }
.pts-about__list .disclosure__body p { font-size: var(--text-md); line-height: 1.55; color: var(--ink-2); }
.pts-fine { display: flex; align-items: flex-start; gap: 12px; margin-top: var(--space-4); padding: 12px 16px; border-radius: var(--radius-md); background: var(--surface-2); font-size: var(--text-md); line-height: 1.55; color: var(--ink-2); }
.pts-fine .icon { width: 20px; height: 20px; margin-top: 2px; color: var(--gold-ink); }
.pts-fine strong { color: var(--ink); }
.pts-about__more { margin-top: var(--space-3); font-size: var(--text-md); }
.pts-about__more a { font-weight: 700; }

/* ------------------------------------------------------------------ motion -- */
@keyframes pts-flash { 0%, 60% { box-shadow: 0 0 0 4px rgba(217, 160, 82, .55); } 100% { box-shadow: 0 0 0 0 rgba(217, 160, 82, 0); } }
@media (prefers-reduced-motion: no-preference) {
  .pts-row.is-flash, .pts-task.is-flash, .pts-joint__card.is-flash { animation: pts-flash 1.2s var(--ease-out) 1; }
  .pts-meter__fill { transition: transform var(--dur-3) var(--ease-out); }
}
@media (prefers-reduced-motion: reduce) {
  .pts-task, .pts-board.is-refreshing .pts-rows { transition: none; }
}

/* ---------------------------------------------------------------- phones -- */
@media (max-width: 900px) {
  .pts-panel[data-panel="me"] .pts-panel__live { grid-template-columns: minmax(0, 1fr); }
  .pts-dash__stats, .pts-dash__tiles { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .pts-task-list { grid-template-columns: minmax(0, 1fr); }
  .pts-join { grid-template-columns: minmax(0, 1fr); }
  .pts-about__list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .pts-dash__tiles { grid-template-columns: minmax(0, 1fr); }
  .pts-dash__stats .stat__note { min-height: calc(2 * 1.4em); }   /* the rank note gains "of N players" with the board: room for it */
  .pts-dash__stats dd, .pts-invite__stats dd { margin: 0; }
.pts-dash__stats .stat, .pts-tile { padding: 12px 14px; }
  .pts-dash__foot > [data-share-open], .pts-tile__btn { width: 100%; }
  .pts-task { grid-template-columns: 40px minmax(0, 1fr); gap: 0 12px; }
  .pts-task__icon { width: 40px; height: 40px; border-radius: var(--radius-md); }
  .pts-task__foot { flex-direction: column; align-items: stretch; }
  .pts-task__action { width: 100%; }
  .pts-task__action > .btn { flex: 1 1 auto; }
  .pts-verify { grid-template-columns: 1fr; }
  .pts-leader { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ring body" "ring pts"; gap: 4px 14px; min-height: 0; position: relative; }
  .pts-leader > .pts-leader__crown { position: absolute; left: 8px; top: 8px; width: 30px; height: 30px; z-index: 1; }
  .pts-leader > .pts-leader__crown .icon { width: 18px; height: 18px; }
  .pts-leader > :nth-child(2) { grid-area: ring; }
  .pts-leader__body { grid-area: body; align-self: end; }
  .pts-leader__pts { grid-area: pts; text-align: left; align-self: start; }
  .pts-leader--skel { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "av lines" "av num"; }
  .pts-leader--skel .pts-skel-av { grid-area: av; }
  .pts-leader--skel .pts-skel-lines { grid-area: lines; }
  .pts-leader--skel .pts-skel-num { grid-area: num; justify-self: start; }
  .pts-row { grid-template-columns: minmax(3.2rem, max-content) 34px minmax(0, 1fr) auto; gap: 12px; padding: 8px 12px; min-height: 54px; }
  .pts-closed { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .pts-closed__body { display: contents; }
  .pts-closed__body > :not(h2) { grid-column: 1 / -1; }
  .pts-closed > .page-mark { width: 40px; height: 40px; border-radius: var(--radius-md); }
  .pts-row__av, .pts-skel-dot { width: 34px; height: 34px; }
  .pts-pager .btn span { display: none; }
  .pts-pager .btn { padding-inline: 12px; }
}
@media (max-width: 380px) {
  .pts-row__unit { display: none; }
  .pts-leader__av { width: 60px; height: 60px; }
}
