/* Account, public profile, social, sign in. Loads after css/theme.css; see
   DESIGN.md for the system.

   These are utility pages, so they stand plain on the back wall: a banner and
   a portrait the trainer chose (cosmetics they own), the name at page-title
   size, one line of what they hold, then words for tabs and rows between
   hairlines. The public profile's showcase is the one place with a material:
   the glass case from Home. Social is a messenger, a list and a thread
   divided by one hairline. */

/* ---- Shared pieces ------------------------------------------------------ */

/* app.css gives every button a 128px floor; these pages size their own. */
:is(#view-account, #view-profile, #view-social, #view-auth, .friends, .player-tip) :is(.ghost, .solid) { min-width: 0; }

:is(#view-account, #view-profile, #view-social) .panel-empty {
  margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; max-width: 60ch;
}

.acct-sec { min-width: 0; }
.acct-sec-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px;
  margin: 0 0 18px;
}
.acct-sec-head h2 {
  margin: 0; font-size: 24px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em;
}
.acct-sec-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; max-width: 58ch; }
.acct-sec-head > :last-child:not(div) { flex: none; }
:is(#view-account, #view-profile, #view-social) .text-btn { background: none; border: 0; }
:is(#view-account, #view-profile, #view-social) .panel-empty .text-btn { padding: 0; }
.acct-sec-head .text-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0; font-size: 14px; }
.acct-cols {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 56px; align-items: start;
}

/* Chip rows scroll sideways on a phone rather than wrapping into a wall. */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Forms on these pages: sentence-case labels in the body face. */
:is(#view-auth, #view-account) .field { display: grid; gap: 7px; margin: 0 0 18px; }
:is(#view-auth, #view-account) .field > span {
  font-family: var(--font); letter-spacing: 0; text-transform: none;
}
:is(#view-auth, #view-account) .field > span:first-child { color: var(--ink-2); font-size: 14px; font-weight: 600; }
:is(#view-auth, #view-account) .field > .hint { color: var(--muted); font-size: 13px; font-weight: 450; line-height: 1.45; opacity: 1; }
:is(#view-auth, #view-account) .field input,
:is(#view-auth, #view-account) .field textarea {
  width: 100%; padding: 10px 14px; border-radius: var(--r-sm); font: inherit; font-size: 16px;
}
:is(#view-auth, #view-account) .field textarea { min-height: 104px; resize: vertical; line-height: 1.45; }
:is(#view-auth, #view-account) .field input:focus-visible,
:is(#view-auth, #view-account) .field textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
/* A handle field carries its @ so nobody types one twice. */
.field-at { position: relative; display: block; }
.field-at::before {
  content: "@"; position: absolute; left: 14px; top: 50%; transform: translateY(-52%);
  color: var(--muted); font-size: 16px; pointer-events: none;
}
:is(#view-auth, #view-account) .field-at input { padding-left: 32px; }
.form-error { margin: 0 0 14px; color: var(--bad); font-size: 14px; font-weight: 500; line-height: 1.45; }
.form-error:empty { display: none; }
.acct-form .solid { min-width: 160px; }

/* ---- Avatars ------------------------------------------------------------ */
/* A portrait disc tinted with the trainer's ring colour, cut out of whatever
   it sits on by a thin gap of page colour, then the ring. */
.user-face {
  background: radial-gradient(circle at 50% 28%, color-mix(in oklab, var(--avatar, #888) 58%, #fff 0%), color-mix(in oklab, var(--avatar, #888) 20%, #0b0a10) 78%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.user-face.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ok); }
.user-face.empty { background: var(--surface-3); box-shadow: none; }
.user-face.sm { width: 36px; height: 36px; }
.user-face.md { width: 56px; height: 56px; }

.trainer-mark.acct-face, .trainer-mark.look-face, .acct-hero .user-face.lg {
  --ring: var(--avatar, var(--ink));
  display: grid; place-items: center; flex: none; overflow: hidden;
  width: var(--face, 112px); height: auto; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, color-mix(in oklab, var(--ring) 60%, #fff 0%), color-mix(in oklab, var(--ring) 18%, #0b0a10) 76%);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--ring);
  font-size: 0;
}
.trainer-mark.acct-face img, .trainer-mark.look-face img, .acct-hero .user-face.lg img {
  width: 92%; height: 92%; object-fit: contain; transform: translateY(5%);
}
.trainer-mark.pixel img, .acct-hero .user-face.lg.pixel img { width: 110%; height: 110%; transform: none; }
.trainer-mark.look-face { --face: 104px; }

/* ---- Banner wash: css/pages/banners.css ------------------------------------- */

/* ---- The trainer header (account, public profile) ------------------------ */
/* The frame (banner, its fade into the page, where the portrait and name sit) is in css/pages/banners.css. */
.acct-copy { min-width: 0; }
/* The trainer's name is the page title here (30 to 40px); signage is for sets and pulls. */
.acct-name {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0;
  font-size: clamp(30px, 4vw, 40px); font-weight: 700; font-variation-settings: "opsz" 48;
  line-height: 1.05; letter-spacing: -0.015em; overflow-wrap: anywhere;
}
.acct-meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 18px;
  margin: 10px 0 0; color: var(--muted); font-size: 14px;
}
.acct-meta .account-handle { color: var(--ink-2); font-weight: 600; }
/* A title is words the trainer chose, so it reads as words. */
.account-title {
  display: inline; margin: 0; padding: 0; border: 0; border-radius: 0; background: none;
  color: var(--ink); font-family: var(--font); font-size: inherit; font-weight: 600;
}
.acct-meta .account-title { font-size: 14px; }
.acct-code { color: var(--muted); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.acct-facts { margin: 12px 0 0; color: var(--ink); font-size: 15px; line-height: 1.45; }
.acct-copy .account-bio { margin: 12px 0 0; max-width: 56ch; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.acct-hero-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 10px;
}
.acct-hero-actions .ghost, .acct-hero-actions .solid { min-width: 0; text-decoration: none; }
.acct-hero-actions .text-btn { min-height: 44px; padding: 0 6px; background: none; border: 0; font-size: 15px; }
.acct-hero.signed-out .brand-logo.lg {
  width: var(--face); height: auto; aspect-ratio: 1; border-radius: var(--r-sm); box-shadow: none;
}
#view-account .acct-hero.signed-out .acct-hero-body { margin-top: 0; align-items: center; }
#view-account .acct-hero.signed-out .acct-copy, #view-account .acct-hero.signed-out .acct-hero-actions { padding-top: 0; }
#view-account .acct-hero.signed-out { margin-bottom: 40px; }
.acct-hero.signed-out .acct-meta { font-size: 15px; color: var(--ink-2); max-width: 46ch; }
/* The claim is the page's one orange action; the badge wall, the level road, the layout
   editor and the two forms each carry their own, so it steps aside there. */
.claim-cta { display: inline-flex; align-items: center; gap: 10px; animation: none; }
#view-account:has(:is(.acct-tab.on[data-acct-tab="achievements"], .acct-tab.on[data-acct-tab="profile"], .acct-tab.on[data-acct-tab="security"])) .acct-hero-actions .claim-cta { display: none; }
/* The amount rides in the button as the coin and a number. */
.claim-amt {
  display: inline-flex; align-items: center; color: inherit;
  font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* ---- Account tabs ------------------------------------------------------- */
/* The tab words and their ink line are in css/pages/quests.css. */
.acct-dot {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 7px; padding: 0 6px;
  border-radius: 999px; background: var(--ink); color: var(--black); font-style: normal; font-size: 11.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---- Overview ----------------------------------------------------------- */
.acct-overview {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 56px 64px; align-items: start;
}
.acct-main { display: grid; gap: 48px; min-width: 0; }
.acct-overview .acct-pulls, .acct-overview .acct-sets { grid-column: 1 / -1; }
/* Net worth reads like it does on Home: a sentence, and the chart plainly under it. */
.acct-worth-line { margin: 0; max-width: 60ch; font-size: 16px; color: var(--ink); }
#view-account .acct-chart { min-height: 0; margin: 14px -4px 0; max-width: 640px; }
#view-account .pc-spark { height: clamp(96px, 11vw, 130px); }
#view-account .pc-svg, #view-account .pc-svg.up, #view-account .pc-svg.flat { --pc-key: var(--ink-2); }
#view-account .pc-svg.down { --pc-key: var(--bad); }
#view-account .pc-line { filter: none; }
#view-account .pc-empty-sm { padding: 18px 4px; color: var(--muted); font-size: 14px; text-align: left; }
#view-account .pc-dot { display: none; }

/* The career: a ledger, label and figure on each ruled row. */
.acct-ledger { max-width: 520px; margin: 0; }
.acct-ledger > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.acct-ledger > div:first-child { border-top-color: var(--line-2); }
.acct-ledger dt { color: var(--ink-2); font-size: 15px; }
.acct-ledger dd { margin: 0; color: var(--ink); font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.acct-ledger .down dd { color: var(--bad); }

.next-list { display: grid; margin: 0; padding: 0; list-style: none; }
.next-row {
  --tone: var(--ink);
  display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 16px; align-items: center;
  padding: 16px 0; border-top: 1px solid var(--line);
}
.next-row:first-child { padding-top: 2px; border-top: 0; }
.next-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.next-head b { font-size: 15px; font-weight: 650; }
.next-row .qa-bar { margin-top: 9px; }
.next-row small { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }

/* The latest pulls: real cards in a row, each with the price tag it would carry in the case. */
#view-account .acct-pull-row {
  display: flex; flex-wrap: nowrap; gap: clamp(14px, 1.6vw, 22px);
  margin: -10px -8px 0; padding: 10px 8px 22px;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
}
#view-account .acct-pull-row::-webkit-scrollbar { display: none; }
.pull-card { position: relative; flex: none; width: clamp(96px, 9.2vw, 132px); scroll-snap-align: start; }
.pull-card .mini-card { width: 100%; }
.pull-card .price-tag { position: absolute; left: 6px; bottom: -10px; font-size: 17px; pointer-events: none; }

/* Set completion: a ruled row per set, its symbol, the count and a hairline bar. */
.set-rings { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 40px; }
#view-account .set-ring {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 9px;
  width: 100%; padding: 12px 0 14px; margin: 0;
  border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none;
  color: inherit; text-align: left; transition: none;
}
#view-account .set-ring:hover { transform: none; background: none; }
#view-account .set-ring:hover .set-ring-copy b { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); }
.set-ring > img { width: 28px; height: 28px; object-fit: contain; }
.set-ring-copy { display: grid; gap: 1px; min-width: 0; }
.set-ring-copy b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-ring-copy small { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.set-ring-pct { color: var(--ink-2); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.set-ring > .qa-bar { grid-column: 1 / -1; }
.set-ring.done > .qa-bar i { background: var(--ink); }
.set-ring.done .set-ring-pct { color: var(--ink); }
.set-rest { margin-top: 18px; }
.set-rest > summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none;
  color: var(--ink-2); font-weight: 600; font-size: 14px;
}
.set-rest > summary::-webkit-details-marker { display: none; }
.set-rest > summary::after {
  content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform 0.2s var(--ease-out);
}
.set-rest[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.set-rest[open] > summary { margin-bottom: 8px; }
.set-rest .set-ring { opacity: 0.78; }

/* The badge wall, quest board and mastery shelf live in css/pages/quests.css. */

/* ---- Pull history sheet ------------------------------------------------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(4, 3, 6, 0.74); }
#view-account .sheet {
  position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column;
  width: min(760px, calc(100% - 32px)); max-height: min(84vh, 860px);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--wall-dark); box-shadow: var(--shadow); overflow: hidden;
}
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 14px; }
.sheet-head h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.sheet-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.sheet-filters {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px;
  padding: 0 24px 16px; border-bottom: 1px solid var(--line);
}
.sheet-total { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.sheet-total b { color: var(--ink); font-weight: 650; }
.sheet-body { padding: 6px 24px 24px; overflow: auto; overscroll-behavior: contain; }
.pull-list { display: grid; }
#view-account .pull-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 12px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none;
}
#view-account .pull-row:first-child { border-top: 0; }
.pull-row .mini-card { width: 56px; }
.pull-row .ghost-card { display: block; aspect-ratio: 63 / 88; border-radius: 4px; background: var(--surface-2); }
.pull-copy { min-width: 0; display: grid; gap: 1px; }
.pull-copy b { font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pull-copy > span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pull-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.pull-tags:empty { display: none; }
.tag {
  padding: 1px 7px; border-radius: 2px; background: var(--surface-2); color: var(--ink-2);
  font-family: var(--font); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; line-height: 1.6;
}
.tag.new { background: var(--ink); color: var(--black); }
.tag.rev { background: var(--surface-3); color: var(--ink); }
.pull-end { display: grid; justify-items: end; gap: 2px; text-align: right; }
.pull-value { color: var(--ink); font-size: 15px; font-weight: 650; white-space: nowrap; }
.pull-end time { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ---- Profile tab -------------------------------------------------------- */
/* What the public sees: a checkbox per figure, plain words. */
.stat-toggles { display: grid; gap: 0; margin: 0 0 24px; max-width: 420px; }
#view-account .stat-toggles label {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0;
  border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink);
  font-size: 15px; font-weight: 560; cursor: pointer;
}
#view-account .stat-toggles label:last-child { border-bottom: 1px solid var(--line); }
#view-account .stat-toggles input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
#view-account .stat-toggles label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
#view-account .share-row {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 6px 6px 6px 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--wall-dark);
}
.share-url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 14px; }
.share-open { display: inline-block; }
.acct-pins { margin-top: 56px; }
#view-account .pin-row { display: flex; flex-wrap: wrap; gap: 22px; margin: -18px -8px 0; }
#view-account .pin-slot { display: grid; gap: 8px; width: clamp(104px, 11vw, 140px); justify-items: center; }
#view-account .pin-slot .mini-card { width: 100%; }
.pin-drop {
  min-height: 32px; padding: 0 10px; border: 0; background: none; color: var(--muted);
  font-size: 13px; font-weight: 560; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint);
}
.pin-drop:hover { color: var(--bad); text-decoration-color: currentColor; }

/* ---- Look tab ----------------------------------------------------------- */
.look-layout {
  display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); gap: 40px 64px; align-items: start;
}
#view-account .look-preview { position: sticky; top: 88px; padding: 0; border: 0; background: none; }
#view-account .look-card {
  isolation: isolate; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: none;
}
#view-account .look-card .acct-banner { height: 116px; border-radius: 0; }
.look-id {
  position: relative; z-index: 1; display: grid; justify-items: center; gap: 2px;
  margin-top: -56px; padding: 0 18px 22px; text-align: center;
}
.trainer-mark.look-face { width: 104px; margin-bottom: 12px; }
.look-id b { font-size: 24px; font-weight: 700; font-variation-settings: "opsz" 48; letter-spacing: -0.015em; line-height: 1.05; overflow-wrap: anywhere; }
.look-id small { color: var(--muted); font-size: 14px; }
.look-id .account-title { margin-top: 10px; }
.look-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.look-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.look-controls { display: grid; gap: 56px; min-width: 0; }
.look-controls .acct-sec-head { align-items: center; }
#view-account .look-controls .field { margin: 24px 0 0; }
.style-picks.seg { flex: none; }
.style-picks .seg-btn { padding: 0 16px; }
#view-account .look-controls .field.avatar-search { margin: 0 0 14px; max-width: 420px; }
.avatar-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px;
  max-height: 348px; overflow: auto; padding: 4px; margin: 0 -4px;
  overscroll-behavior: contain;
}
.pick {
  position: relative; display: grid; justify-items: center; gap: 4px; padding: 8px 4px 6px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: inherit; cursor: pointer; overflow: hidden;
}
.pick:hover { background: var(--surface-2); }
.pick.on { background: var(--surface-3); box-shadow: inset 0 0 0 1.5px var(--ink); outline: 0; }
.pick img { display: block; width: 60px; height: 60px; object-fit: contain; background: none; }
.pick img.pixel { image-rendering: pixelated; }
.pick small { max-width: 100%; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick.on small { color: var(--ink); }
.color-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.color-pick {
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.color-pick:hover { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45); }
.color-pick.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.title-wall {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px;
  max-height: 420px; overflow: auto; padding: 2px; overscroll-behavior: contain;
}
#view-account .title-chip {
  position: relative; display: grid; align-content: start; gap: 3px; min-height: 0;
  padding: 11px 14px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: none; color: var(--ink); text-align: left; animation: none;
}
#view-account .title-chip:hover:not(:disabled) { border-color: var(--line-2); background: none; }
#view-account .title-chip b { font-size: 14px; font-weight: 650; padding-right: 64px; }
#view-account .title-chip small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
#view-account .title-chip.on { background: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); color: var(--ink); }
#view-account .title-chip.on small { color: var(--ink-2); }
#view-account .title-chip.locked { opacity: 0.42; cursor: default; }

/* ---- Security ----------------------------------------------------------- */
.acct-danger .danger-btn {
  border: 1px solid rgba(255, 107, 107, 0.35); background: rgba(255, 107, 107, 0.06); color: #ff8c8c;
}
.acct-danger .danger-btn:hover:not(:disabled) { background: rgba(255, 107, 107, 0.14); border-color: rgba(255, 107, 107, 0.55); }

/* ---- Reward flash ------------------------------------------------------- */
.reward-flash {
  position: fixed; z-index: 120; left: 50%; top: calc(84px + env(safe-area-inset-top));
  display: grid; justify-items: center; gap: 2px; padding: 16px 28px 16px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--wall-dark); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; text-align: center;
  transform: translate(-50%, -14px) scale(0.94);
  transition: opacity 0.25s ease, transform 0.45s var(--ease-spring);
}
.reward-flash.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.reward-flash b {
  color: var(--ink); font-size: 36px; font-weight: 800; font-variation-settings: "opsz" 96;
  letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums;
}
.reward-flash span { margin-top: 6px; color: var(--ink); font-size: 14px; font-weight: 600; }
.reward-flash i {
  color: var(--ink-2); font-family: var(--font); font-style: normal; font-size: 13px; font-weight: 500;
  letter-spacing: 0; text-transform: none;
}

/* ---- Public profile ----------------------------------------------------- */
#view-profile .profile-page { padding-bottom: 24px; }
#view-profile .profile-loading, #view-profile .profile-missing { padding: 48px 0; }
#view-profile .profile-hero { margin-bottom: 0; }
#view-profile .profile-showcase { margin: 56px 0 0; padding: 0; border: 0; background: none; }
/* The showcase is the reason to open a profile, so it stands in the glass case from Home
   (css/counter.css): top-loaders on the glass shelf, a price tag on each. The layout the
   trainer picked only changes how the cards are arranged inside it. */
.profile-case .loader:has(.lit), .profile-case .loader:has(.settling) { z-index: 5; }
.profile-case .case-in { padding-top: 62px; }
.profile-case .case-h { font-size: 24px; }
.profile-case .case-loaders { margin-top: 36px; }
.profile-case[data-style="grid"] { --case-cols: 3; }
.profile-case[data-style="grid"] .case-loaders { max-width: 700px; }
.case-stage { display: grid; grid-template-columns: minmax(200px, 320px) minmax(0, 1fr); gap: 36px clamp(28px, 4vw, 56px); align-items: start; margin-top: 36px; }
.case-stage .case-loaders { margin-top: 0; }
.case-best { --case-cols: 1; }
.case-best .loader { max-width: 320px; }
.case-best .loader-cap b { font-size: 17px; }
.case-rest { --case-cols: 3; gap: 44px 20px; }
.case-rest .loader-cap { margin-top: 18px; }
.case-rest .loader-cap b { font-size: 13.5px; }
#view-profile .profile-binder { margin: 56px 0 0; }
/* The binder is its own object; the section around it is just a title. */
#view-profile .profile-binder.panel { padding: 0; border: 0; background: none; box-shadow: none; }
#view-profile .profile-binder h3 { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
#view-profile .profile-binder > .panel-empty { margin: 8px 0 14px; }
#view-profile .profile-section-head > span { color: var(--muted); font-size: 14px; }
/* Graded: the slabs a trainer chose to show, standing on the page like their own box. */
#view-profile .profile-graded { margin: 56px 0 0; padding: 0; border: 0; background: none; }
#view-profile .profile-graded .acct-sec-head { align-items: flex-end; }
#view-profile .profile-graded .acct-sec-head .ghost { text-decoration: none; }
.graded-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 28px 24px; padding: 4px 0 0; }
.graded-slot { margin: 0; min-width: 0; }
.graded-slot:has(.lit), .graded-slot:has(.settling) { position: relative; z-index: 5; }
.graded-slot figcaption { display: grid; gap: 3px; margin-top: 10px; padding: 0 2px; min-width: 0; line-height: 1.3; }
.graded-slot figcaption b { font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graded-slot .graded-grade { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.graded-slot .graded-worth { color: var(--ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.graded-slot figcaption a {
  justify-self: start; margin-top: 2px; color: var(--ink-2); font-size: 13px; font-weight: 600;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--faint);
}
.graded-slot figcaption a:hover { color: var(--ink); text-decoration-color: var(--ink); }
#view-profile .profile-wall { margin-top: 56px; max-width: 760px; }
.comment-list { display: grid; margin: 0 0 20px; padding: 0; list-style: none; }
#view-profile .comment-item {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px;
  padding: 16px 0; border: 0; border-top: 1px solid var(--line);
}
#view-profile .comment-item:first-child { border-top: 0; padding-top: 0; }
.comment-item a { color: inherit; text-decoration: none; }
.comment-by { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.comment-by b { font-size: 15px; font-weight: 650; }
.comment-by time { color: var(--muted); font-size: 13px; }
.comment-item p:not(.comment-by) { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
#view-profile .comment-form { display: grid; justify-items: end; gap: 10px; margin: 8px 0 0; }
#view-profile .comment-form textarea {
  width: 100%; min-height: 96px; padding: 12px 14px; resize: vertical;
  border-radius: var(--r-sm); font: inherit; font-size: 16px; line-height: 1.45;
}
#view-profile .comment-form textarea:focus { border-color: var(--ink); background: var(--wall-dark); box-shadow: 0 0 0 1px var(--ink); outline: none; }
#view-profile .profile-wall .panel-note { color: var(--muted); font-size: 15px; }

/* ---- Social ------------------------------------------------------------- */
#view-social .social-head { margin-bottom: 28px; }
#view-social .social-head h2, .social-gate h2 {
  margin: 0 0 8px; font-size: clamp(30px, 4vw, 40px); font-weight: 700; font-variation-settings: "opsz" 48;
  line-height: 1.05; letter-spacing: -0.015em;
}
#view-social .social-head p { color: var(--ink-2); font-size: 15px; }
/* A messenger is one object: the friends list and the open thread side by
   side in a single panel. */
#view-social .social-grid {
  display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  min-height: 540px; margin: 0;
  border-block: 1px solid var(--line);
}
.social-friends {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 20px 20px 16px 0; border-right: 1px solid var(--line);
}
#view-social .social-add { display: flex; gap: 8px; margin: 0 0 12px; }
#view-social .social-add input {
  flex: 1; min-width: 0; padding: 0 14px; border-radius: var(--r-sm); font: inherit; font-size: 15px;
}
#view-social .social-add input:focus { border-color: var(--ink); background: var(--wall-dark); box-shadow: 0 0 0 1px var(--ink); outline: none; }
#view-social .social-add .ghost { min-width: 0; padding: 0 16px; border-radius: var(--r-sm); }
#view-social .friends-label { margin: 12px 8px 4px; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; font-family: var(--font); }
.social-requests { display: grid; gap: 2px; }
#view-social .friends-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 8px 0; border-radius: var(--r-sm);
}
#view-social .friends-row a { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
#view-social .friends-row a > span { min-width: 0; }
#view-social .friends-row b, .dm-thread b { display: block; font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#view-social .friends-row small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#view-social .friends-row.dim { opacity: 0.7; }
.friends-row-actions { display: flex; align-items: center; gap: 4px; }
.friends-row-actions .text-btn { min-height: 34px; padding: 0 6px; background: none; border: 0; font-size: 13px; }
.dm-threads { display: grid; gap: 2px; align-content: start; }
#view-social .dm-thread {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 8px; border: 0; border-radius: var(--r-sm); background: transparent;
  color: inherit; text-decoration: none;
}
#view-social .dm-thread:first-child { margin-inline: -8px; }
#view-social .dm-thread:hover { background: var(--surface); }
#view-social .dm-thread.on { background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--ink); }
.dm-thread > span { min-width: 0; }
.dm-thread small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-thread time { align-self: start; margin-top: 3px; color: var(--faint); font-size: 12px; white-space: nowrap; }
.dm-pane { display: flex; flex-direction: column; min-width: 0; min-height: 540px; max-height: min(74vh, 720px); }
.dm-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 0 12px 20px;
  border-bottom: 1px solid var(--line);
}
.dm-back { display: none; }
.dm-who { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.dm-who b { display: block; font-size: 16px; font-weight: 650; }
.dm-who small { display: block; color: var(--muted); font-size: 13px; }
.dm-profile { flex: none; font-size: 14px; }
.dm-log {
  flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 4px; padding: 20px 0 12px 20px;
}
.dm-line { display: grid; justify-items: start; max-width: min(78%, 520px); align-self: flex-start; }
.dm-line + .dm-line.mine, .dm-line.mine + .dm-line:not(.mine) { margin-top: 10px; }
.dm-line span {
  display: block; padding: 10px 14px; border-radius: 10px 10px 10px 3px;
  background: var(--surface-2); color: var(--ink); font-size: 15px; line-height: 1.4; overflow-wrap: anywhere;
}
.dm-line.mine { align-self: flex-end; justify-items: end; }
.dm-line.mine span { background: var(--wall-dark); box-shadow: inset 0 0 0 1px var(--line-2); border-radius: 10px 10px 3px 10px; }
.dm-line time { margin: 4px 8px 6px; color: var(--faint); font-size: 12px; }
.dm-empty { margin: auto; color: var(--muted); font-size: 15px; text-align: center; }
.dm-form { display: flex; gap: 8px; padding: 12px 0 12px 20px; border-top: 1px solid var(--line); }
#view-social .dm-form input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border-radius: var(--r-sm); font: inherit; font-size: 16px;
}
#view-social .dm-form input:focus { border-color: var(--ink); background: var(--wall-dark); box-shadow: 0 0 0 1px var(--ink); outline: none; }
.dm-form .solid { min-width: 88px; border-radius: var(--r-sm); }
.dm-idle { margin: auto; padding: 32px; text-align: center; color: var(--muted); font-size: 15px; }
.dm-idle p { margin: 0 0 4px; }
.dm-idle b { color: var(--ink-2); font-weight: 600; }

/* Trading is next: two empty pockets say what goes here. */
.trade-soon {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px 56px;
  margin-top: 48px; padding-top: 36px; border-top: 1px solid var(--line);
}
.trade-copy h2 {
  display: flex; align-items: center; gap: 12px; margin: 0 0 8px;
  font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
}
.trade-copy p { margin: 0 0 12px; color: var(--muted); font-size: 15px; max-width: 56ch; }
.trade-slips { display: flex; align-items: center; gap: 18px; }
.trade-slot {
  width: clamp(72px, 7vw, 96px); aspect-ratio: 63 / 88; border-radius: 6px;
  border: 1.5px dashed var(--line-2); background: var(--well);
}
.trade-slips svg { width: 28px; height: 28px; fill: none; stroke: var(--muted); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.social-gate { max-width: 560px; padding: 24px 0; }
.social-gate p { margin: 0 0 20px; color: var(--ink-2); font-size: 16px; }
.social-gate-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* The home lounge's online chips and chat lines. */
.online-chip {
  min-height: 44px; padding: 4px 12px 4px 4px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--ink); font-size: 14px; font-weight: 560;
}
.online-chip:hover { background: var(--surface); border-color: transparent; }
.chat-line b { color: var(--ink); font-size: 13px; font-weight: 650; }
.chat-line span { color: var(--ink-2); font-size: 14px; }

/* ---- Friends, in the top bar --------------------------------------------- */
/* js/social.js mounts this into the header's .header-tools: a plain icon, and
   the list drops down under it like the More menu. On a phone the icon lives
   in the More sheet instead and the list rises from the tab bar
   (css/theme.css hides the header icon there). */
.friends { position: relative; }
.friends .friends-peek {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-2);
}
.friends .friends-peek:hover, .friends.is-open .friends-peek { color: var(--ink); }
.friends-peek svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* Someone on the list is online now: green only ever means live. */
.friends-peek-live { position: absolute; top: 10px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--wall-dark); }
.friends-peek-live[hidden], .friends-peek-count[hidden] { display: none; }
/* Friend requests waiting in the inbox. */
.friends-peek-count {
  position: absolute; top: 3px; right: 0; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--ink); color: var(--black);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}
.friends .friends-panel {
  display: none; position: absolute; top: calc(100% + 11px); right: 0; z-index: 36;
  width: 340px; max-width: calc(100vw - 32px); padding: 16px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--wall-dark); box-shadow: var(--shadow);
}
.friends.is-open .friends-panel { display: block; }
@keyframes dock-in { from { opacity: 0; transform: translateY(8px) scale(0.97); } }
.friends-now { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 0 0 14px; }
.friends-kicker { display: none; }
.friends-now b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.friends-now small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.friends-hide {
  display: grid; place-items: center; width: 44px; height: 44px; margin: -10px -10px 0 0; padding: 0;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-2); font-size: 18px; line-height: 1;
}
.friends-hide:hover { color: var(--ink); }
.friends .friends-add { display: flex; gap: 8px; margin: 0 0 12px; }
.friends .friends-add input { flex: 1; min-width: 0; padding: 0 14px; font: inherit; font-size: 16px; }
.friends .friends-add .solid { min-width: 0; padding: 0 18px; }
.friends .friends-tabs { display: flex; width: 100%; margin: 0 0 8px; }
.friends .friends-tabs button { flex: 1; padding: 0 12px; }
.friends-list {
  display: grid; gap: 0; max-height: min(320px, 44vh); overflow-x: hidden; overflow-y: auto;
  margin: 0 -6px; padding: 4px 6px; overscroll-behavior: contain;
}
.friends .friends-row { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 6px 4px; border-radius: var(--r-sm); }
.friends .friends-row:hover { background: var(--surface); }
.friends .friends-row a { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.friends .friends-row a > span { min-width: 0; }
.friends .friends-row b { display: block; font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friends .friends-row small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friends .friends-row.dim { opacity: 0.7; }
.friends .friends-row .tiny { flex: none; min-width: 34px; min-height: 34px; padding: 0 10px; border-radius: var(--r-sm); font-size: 13px; }
.friends .friends-row [data-friend-remove] { background: none; border: 0; color: var(--faint); padding: 0; min-width: 30px; font-size: 18px; }
.friends .friends-row [data-friend-remove]:hover { color: var(--bad); background: none; }
.friends .friends-row .solid, .friends .friends-row .ghost { min-height: 34px; padding: 0 12px; font-size: 13px; }
.friends-empty { margin: 6px 4px 10px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.friends .friends-label { margin: 12px 4px 4px; color: var(--muted); font-size: 13px; font-weight: 600; font-family: var(--font); letter-spacing: 0; text-transform: none; }
.friends-list > .solid { width: 100%; }
@media (max-width: 720px) {
  .friends .friends-panel {
    position: fixed; top: auto; left: 8px; right: 8px; bottom: calc(var(--tabbar) + 6px);
    width: auto; max-width: none; max-height: calc(100dvh - var(--tabbar) - 76px); overflow-y: auto;
  }
}

/* ---- Trainer tooltip (tap a name in chat) -------------------------------- */
.player-tip {
  position: fixed; z-index: 40; isolation: isolate; width: 320px; overflow: hidden;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--wall-dark); box-shadow: var(--shadow);
}
.player-tip.hidden { display: none; }
.player-tip:not(.hidden) { animation: dock-in 0.24s var(--ease-out); transform-origin: 50% 0; }
.tip-banner {
  position: relative; z-index: 0; height: 84px; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 35%, transparent);
  mask-image: linear-gradient(180deg, #000 35%, transparent);
}
.tip-id { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 12px; margin-top: -34px; padding: 0 16px; }
.tip-id .user-face.md { width: 64px; height: 64px; box-shadow: 0 0 0 3px var(--wall-dark), 0 0 0 5px var(--avatar, var(--ink)); }
.tip-id .user-face.md.on { box-shadow: 0 0 0 3px var(--wall-dark), 0 0 0 5px var(--ok); }
.tip-id > div { min-width: 0; padding-bottom: 2px; }
.tip-id .account-title { min-height: 22px; padding: 1px 9px; margin-bottom: 6px; font-size: 12px; }
.tip-id b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; }
.tip-id small { color: var(--muted); font-size: 13px; }
.tip-bio, .tip-stats { position: relative; z-index: 1; margin: 12px 16px 0; font-size: 14px; line-height: 1.45; }
.tip-bio { color: var(--ink-2); }
.tip-stats { color: var(--muted); }
.tip-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px 16px; }
.tip-actions .solid, .tip-actions .ghost { flex: 1; min-width: 0; }
.tip-status { align-self: center; color: var(--muted); font-size: 14px; font-weight: 600; }
.player-tip .lounge-empty { padding: 16px; margin: 0; }

/* ---- Sign in / create account ------------------------------------------- */
/* The shop's mark, a title, two words to switch, a short form on the wall and one orange button. */
#view-auth .auth-page {
  display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 0;
  width: 100%; max-width: 400px; margin: clamp(0px, 4vh, 40px) auto 0;
}
#view-auth .auth-copy { text-align: center; margin: 0 0 28px; }
.auth-mark { display: block; width: 56px; height: 56px; margin: 0 auto 20px; border-radius: var(--r-sm); }
#view-auth .auth-copy h1 {
  margin: 0 0 12px; font-size: clamp(30px, 4vw, 40px); font-weight: 700; font-variation-settings: "opsz" 48;
  line-height: 1.05; letter-spacing: -0.015em;
}
#view-auth .auth-copy .lede { margin: 0 auto; max-width: 36ch; color: var(--ink-2); font-size: 15.5px; line-height: 1.5; }
#view-auth .auth-card { width: 100%; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
/* Two words with the ink line under the open one, like every other picker. */
#view-auth .auth-tabs {
  display: flex; gap: 26px; width: 100%; margin: 0 0 26px; padding: 0;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none;
}
#view-auth .auth-tab {
  position: relative; flex: none; min-height: 44px; padding: 8px 0 12px; margin: 0;
  border: 0; border-radius: 0; background: none; box-shadow: none;
  color: var(--muted); font-size: 15px; font-weight: 600;
}
#view-auth .auth-tab + .auth-tab { border-left: 0; }
#view-auth .auth-tab:hover { color: var(--ink); background: none; }
#view-auth .auth-tab.on { color: var(--ink); background: none; box-shadow: none; }
#view-auth .auth-tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); }
.auth-form .solid { width: 100%; min-height: 48px; margin-top: 4px; font-size: 16px; }
#view-auth .check-row { margin: 0 0 18px; color: var(--ink-2); font-size: 14px; }
#view-auth .color-picks { gap: 8px; }
#view-auth .color-pick { width: 32px; height: 32px; }
.auth-foot { display: grid; justify-items: center; gap: 20px; width: 100%; margin-top: 22px; text-align: center; }
.auth-foot .auth-guest { width: auto; min-height: 44px; margin: 0; padding: 0 8px; background: none; border: 0; font-size: 15px; }
.auth-points { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.auth-points li { padding: 0; }
.auth-points li::before { content: none; }

/* The sign-in gate other pages show when nobody is signed in. */
.need-account { flex: 1 0 100%; margin: 0 0 12px; padding: 4px 0 8px; }
.need-account p { margin: 0 0 14px; max-width: 56ch; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.need-account .account-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }

/* ---- Laptop to tablet --------------------------------------------------- */
@media (max-width: 1040px) {
  .acct-overview { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .look-layout { grid-template-columns: minmax(0, 1fr); }
  #view-account .look-preview { position: static; max-width: 420px; }
}
@media (max-width: 900px) {
  .acct-cols { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  #view-profile .showcase-row { flex-wrap: wrap; }
  #view-profile .showcase-slot { flex-basis: 150px; }
}

/* ---- Phone -------------------------------------------------------------- */
@media (max-width: 720px) {
  .acct-meta { margin-top: 10px; }
  .acct-hero-actions .solid { flex: 1 1 100%; }
  .acct-hero-actions .ghost { flex: 1 1 0; padding: 0 10px; }
  .acct-hero.signed-out .acct-hero-actions .solid { flex: 1 1 0; }

  .acct-sec-head h2 { font-size: 22px; }
  .acct-overview { gap: 44px; }
  #view-account .acct-pull-row { margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
  .set-rings { grid-template-columns: minmax(0, 1fr); }

  .sheet-filters .chip-row {
    flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
    margin-inline: -16px; padding-inline: 16px;
  }
  .sheet-filters .chip-row::-webkit-scrollbar { display: none; }
  .sheet-filters .pick-chip { flex: none; scroll-snap-align: start; }

  /* Pull history rises from the bottom like a sheet. */
  #view-account .sheet {
    left: 0; right: 0; top: auto; bottom: 0; transform: none;
    width: 100%; max-height: 88vh; max-height: 88svh;
    border-radius: var(--r-sm) var(--r-sm) 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  #view-account .sheet::before {
    content: ""; align-self: center; flex: none; width: 40px; height: 4px; margin: 10px 0 0;
    border-radius: 2px; background: var(--line-2);
  }
  .sheet-head { padding: 14px 16px 12px; }
  .sheet-filters { padding: 0 16px 14px; }
  .sheet-body { padding: 4px 16px 20px; }
  #view-account .pull-row { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; }
  .pull-row .mini-card { width: 48px; }

  .acct-pins { margin-top: 48px; }
  #view-account .pin-row { gap: 14px; }
  #view-account .pin-slot { width: calc((100% - 28px) / 3); }
  .look-controls { gap: 48px; }
  .look-controls .acct-sec-head { flex-wrap: wrap; align-items: flex-end; }
  .avatar-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); max-height: 300px; }
  .title-wall { grid-template-columns: minmax(0, 1fr); max-height: 360px; }
  .acct-form .solid { width: 100%; }

  /* Profile: the case runs edge to edge on a phone, two cards across. */
  #view-profile .profile-showcase { margin-top: 44px; }
  .profile-case .case-in { padding-top: 54px; }
  .profile-case[data-style="grid"] { --case-cols: 2; }
  .case-stage { grid-template-columns: minmax(0, 1fr); gap: 36px; margin-top: 30px; }
  .case-best .loader { max-width: 230px; margin-inline: auto; }
  .case-rest { --case-cols: 2; gap: 40px 18px; }
  #view-profile .profile-wall { margin-top: 44px; }
  #view-profile .profile-graded { margin-top: 44px; }
  .graded-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }

  /* Social: one pane at a time, like a phone messenger. */
  #view-social .social-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .social-friends { border-right: 0; padding: 16px 0; }
  #view-social .social-grid:not(.has-thread) .dm-pane { display: none; }
  #view-social .social-grid.has-thread .social-friends { display: none; }
  /* An open thread takes the screen: the page title steps aside and the pane
     fills the space between the header and the tab bar. */
  #view-social:has(.social-grid.has-thread) .social-head { display: none; }
  .dm-pane { min-height: 0; max-height: none; height: calc(100svh - var(--tabbar) - 92px - env(safe-area-inset-top)); }
  .dm-head { padding: 10px 12px 10px 6px; gap: 6px; }
  .dm-back {
    display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; color: var(--ink);
  }
  .dm-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .dm-back:hover { background: var(--surface-2); }
  .dm-log { padding: 16px 12px 10px; }
  .dm-line { max-width: 84%; }
  .dm-form { padding: 10px; }
  .trade-soon { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 36px; padding-top: 28px; }
  .trade-slips { justify-content: flex-start; }

  #view-auth .auth-copy { margin-bottom: 22px; }
  .auth-mark { width: 48px; height: 48px; margin-bottom: 16px; }
  #view-auth .auth-card { padding: 20px 16px; }

  .player-tip { width: calc(100vw - 24px); }
}
/* ---- Motion off --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .friends.is-open .friends-panel, .player-tip:not(.hidden) { animation: none; }
  .reward-flash { transition: opacity 0.2s ease; transform: translate(-50%, 0); }
  .set-rest > summary::after { transition: none; }
}
body.no-motion .friends.is-open .friends-panel, body.no-motion .player-tip:not(.hidden) { animation: none; }
body.no-motion .reward-flash { transition: opacity 0.2s ease; transform: translate(-50%, 0); }
