/* Public player profile (/player/, site theme 4.0.0). Shared pieces (finder, medals, star rows, podium colours) live in
   /rankings/assets/rankings.css; chrome, panels, portraits and buttons in /site.css. */

.player-page > .stone, .player-page > div > .stone { margin-bottom: 26px; }
.player-page > * + * { margin-top: 0; }

/* ------------------------------------------------------------------ the finder strip */
.finder-panel { z-index: 5; padding-block: 20px 22px; }
.finder-panel .crumbs { margin: 0 0 12px; font: 700 14px/1.3 var(--body); color: var(--muted); }
.finder-panel .crumbs .sep { margin: 0 8px; opacity: .7; }
.finder-panel .finder { max-width: none; margin: 0; }

/* ------------------------------------------------------------------ the header card */
.pcard { display: flex; align-items: center; gap: clamp(20px, 3.4vw, 40px); padding: clamp(26px, 3.6vw, 42px); }
.pc-portrait { position: relative; flex: none; padding-top: 14px; }
.pc-portrait .portrait { --size: 140px; position: relative; z-index: 1; box-shadow: 0 0 0 1px var(--line), 0 16px 24px rgba(0, 0, 0, .6); }
.pc-portrait .portrait::after { box-shadow: inset 0 0 0 2px var(--ring), inset 0 -8px 10px -5px rgba(0, 0, 0, .55); }
.pc-r1 .portrait { box-shadow: 0 0 0 1px var(--gold), 0 0 0 5px var(--well-2), 0 0 0 6px rgba(255, 138, 61, .5), 0 16px 24px rgba(0, 0, 0, .6); }
.pc-r2 .portrait { box-shadow: 0 0 0 1px var(--silver), 0 0 0 5px var(--well-2), 0 0 0 6px rgba(214, 217, 223, .4), 0 16px 24px rgba(0, 0, 0, .6); }
.pc-r3 .portrait { box-shadow: 0 0 0 1px var(--bronze), 0 0 0 5px var(--well-2), 0 0 0 6px rgba(224, 161, 112, .4), 0 16px 24px rgba(0, 0, 0, .6); }
.pc-portrait .crown { position: absolute; z-index: 2; top: -16px; left: 50%; width: 64px; margin: 0 0 0 -32px; transform: rotate(-6deg); }
.pc-info { flex: 1; min-width: 0; }
.pc-info h1 { margin: 0 0 12px; color: var(--text); font-size: clamp(32px, 4.4vw, 52px); overflow-wrap: anywhere; }
.pc-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 16px; }
.pc-tags .cls { margin: 0; font-size: 13px; line-height: 20px; padding: 2px 10px; }
.tag { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; overflow-wrap: anywhere; padding: 3px 12px; background: var(--well); border: 1px solid var(--line-soft); border-radius: 999px; font: 500 15px/20px var(--body); color: var(--text); }
.tag .ico { width: 15px; height: 15px; color: var(--gold); }
.pc-rank { display: flex; align-items: center; gap: 12px; margin: 0; max-width: 60ch; color: var(--text); font-variant-numeric: tabular-nums; }
.pc-rank b { color: var(--gold); font-weight: 800; }
.pc-rank .medal { width: 40px; height: 40px; font-size: 17px; }
.pc-rank .medal.plain { background: var(--well); color: var(--text); box-shadow: 0 0 0 1px var(--line) inset; }
.muted-line { color: var(--muted); }
.pc-actions { flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 12px; align-self: flex-start; }
.pc-actions .btn { min-width: 150px; }
.pc-actions .btn.done { color: var(--ok); background: rgba(90, 170, 110, .08); box-shadow: 0 0 0 1px rgba(140, 210, 160, .4) inset; }
.btn-mini { min-height: 42px; padding: 11px 16px; font-size: 14px; }

/* ------------------------------------------------------------------ the hero switcher */
.switcher { padding-block: clamp(20px, 2.6vw, 28px); }
.switcher .stone-head { margin-bottom: 16px; }
.switcher h2 { font-size: clamp(22px, 2.6vw, 28px); }
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  appearance: none; cursor: pointer; display: flex; align-items: center; gap: 11px; min-width: 0;
  padding: 8px 18px 8px 10px; text-align: left; color: var(--text); font: inherit;
  background: var(--well); border: 1px solid var(--line-soft); border-radius: 999px;
  transition: background-color .15s ease, border-color .15s ease, transform .18s var(--ease-out);
}
.chip:hover { background: rgba(255, 138, 61, .07); border-color: var(--line); transform: translateY(-2px); }
.chip[aria-selected="true"] { background: var(--panel-hi); border-color: var(--gold); }
.chip-text { display: block; min-width: 0; line-height: 1.2; }
.chip-text b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 17ch; font: 700 16px/1.2 var(--display); color: var(--text); }
.chip-text small { color: var(--muted); font: 500 14px/1.3 var(--body); }
.chip[aria-selected="true"] .chip-text b { color: var(--gold); }

/* ------------------------------------------------------------------ record, equipment, collection */
.pgrid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.pgrid > * { min-width: 0; }
.pgrid .stone { margin: 0; }
.pside { display: grid; gap: 26px; }

.seg { display: inline-flex; padding: 3px; background: var(--well-2); border: 1px solid var(--line-soft); border-radius: 10px; }
.seg button { appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; font: 700 13px/1.1 var(--display); letter-spacing: .03em; transition: background-color .15s ease, color .15s ease; }
.seg button:hover { color: var(--text); background: rgba(255, 138, 61, .07); }
.seg button[aria-pressed="true"] { color: var(--on-gold); background: var(--ember); }
.seg .count { font: 700 12px/1 var(--body); opacity: .8; font-variant-numeric: lining-nums tabular-nums; }

.rec-list { list-style: none; margin: 0; padding: 0; background: var(--well); border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; }
.rec-row { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto 18px; grid-template-areas: "medal name score stars go" "medal meta score stars go"; align-items: center; column-gap: 14px; row-gap: 1px; padding: 10px 16px 10px 12px; transition: background-color .15s ease; }
.rec-row + .rec-row { border-top: 1px solid var(--line-soft); }
.rec-row:hover { background: rgba(255, 138, 61, .07); }
.rec-medal { grid-area: medal; }
.rec-medal .medal { margin-inline: auto; }
.rec-name { grid-area: name; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font: 700 16px/1.25 var(--display); text-decoration: none; transition: color .15s ease; }
.rec-name::after { content: ""; position: absolute; inset: 0; }
.rec-row:hover .rec-name { color: var(--gold); }
.rec-meta { grid-area: meta; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.rec-meta .dread-tag { color: var(--dread); font-weight: 800; }
.rec-score { grid-area: score; text-align: right; color: var(--gold); font: 800 18px/1 var(--display); font-variant-numeric: lining-nums tabular-nums; }
.rec-stars { grid-area: stars; }
.rec-row .go { grid-area: go; }
.rec-row:hover .go { color: var(--gold); opacity: 1; transform: translateX(3px); }
.more { margin-top: 16px; }
.muted-inline { opacity: .75; font-size: .85em; }

.gear-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gear-list li { display: flex; align-items: center; gap: 13px; padding: 9px 12px 9px 9px; background: var(--well); border: 1px solid var(--line-soft); border-radius: 8px; }
.gear-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; color: var(--gold); background: var(--well-2); border: 1px solid var(--line); border-radius: 50%; }
.gear-ico .ico { width: 24px; height: 24px; }
.gear-text { min-width: 0; line-height: 1.25; }
.gear-text b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gear-text small { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.facts { margin: 0; display: grid; }
.facts > div { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 11px 2px; }
.facts > div + div { border-top: 1px solid var(--line-soft); }
.facts .ico { color: var(--gold); }
.facts dt { color: var(--muted); font-weight: 700; }
.facts dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ not found, loading */
.notfound { text-align: center; padding-block: clamp(36px, 5vw, 60px); }
.notfound h1 { margin: 0 0 12px; color: var(--text); font-size: clamp(28px, 4vw, 44px); overflow-wrap: anywhere; }
.notfound p { max-width: 52ch; margin: 0 auto 24px; color: var(--text); }

.profile-skeleton { display: grid; gap: 18px; margin-bottom: 26px; }
.profile-skeleton span { display: block; height: 76px; border: 1px solid var(--line-soft); border-radius: 8px; background: linear-gradient(100deg, var(--panel-solid) 30%, #2a1a10 50%, var(--panel-solid) 70%) 0 0 / 220% 100%; }
.profile-skeleton .sk-card { height: 210px; }
.profile-skeleton .short { width: 60%; }
@media (prefers-reduced-motion: no-preference) {
  .profile-skeleton span { animation: shimmer 1.6s linear infinite; }
  .pcard { animation: card-in .6s var(--ease-out) both; }
  .pc-portrait .crown { animation: crown-in .9s .35s var(--ease-out) both; }
}
@keyframes card-in { from { transform: translateY(18px); } }

/* ------------------------------------------------------------------ narrower screens */
@media (max-width: 960px) {
  .pgrid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .pcard { flex-wrap: wrap; justify-content: center; text-align: center; }
  .pc-info { flex: 1 1 100%; }
  .pc-tags, .pc-rank { justify-content: center; }
  .pc-rank { text-align: left; margin-inline: auto; }
  .pc-actions { flex-direction: row; flex-wrap: wrap; justify-content: center; align-self: auto; flex: 1 1 100%; }
  .pc-actions .btn { min-width: 0; flex: 1 1 140px; }
}
@media (max-width: 640px) {
  .chip { flex: 1 1 100%; }
  .chip-text b { max-width: none; }
  .rec-row { grid-template-columns: 38px minmax(0, 1fr) auto; grid-template-areas: "medal name score" "medal meta stars"; column-gap: 11px; padding: 11px 12px 11px 12px; }
  .rec-row .go { display: none; }
  .rec-name, .rec-meta { overflow: visible; text-overflow: clip; white-space: normal; }
  .rec-name { font-size: 16px; }
  .rec-stars .star { width: 15px; height: 15px; }
  .rec-stars { justify-self: end; }
  .seg { width: 100%; }
  .seg button { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .chip { transition: none; }
  .chip:hover { transform: none; }
}
