/* Paddock — Profile page (mockup Profile.dc.html). Loaded after paddock.css. */

.pd-profile {
  color: var(--pd-ink);
  font-family: var(--pd-display);
  font-stretch: 100%;
}

.pd-profile [hidden] { display: none !important; }
.pd-profile a { text-decoration: none; }
.pd-profile h1,
.pd-profile h2 { margin: 0; }

/* ---------- Hero ---------- */

.pd-profile-hero {
  position: relative;
  z-index: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--pd-line);
  background: var(--pd-bg);
}

.pd-profile-hero-media {
  position: absolute;
  inset: 0;
  z-index: -3;
  display: none;
  background-color: var(--pd-bg);
  background-position: center right;
  background-size: cover;
}

.pd-profile-hero.has-image .pd-profile-hero-media { display: block; }

.pd-profile-hero-media::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #0b0b0c 0%, rgba(11, 11, 12, 0.9) 42%, rgba(11, 11, 12, 0.62) 100%),
    linear-gradient(0deg, #0b0b0c 0%, rgba(11, 11, 12, 0) 55%);
  content: "";
}

/* Custom hero colour: a soft glow from the top-right + accent bands */
.pd-profile-hero.has-accent::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: radial-gradient(90% 120% at 100% 0%, var(--pd-hero-glow, transparent) 0%, transparent 62%);
  content: "";
  pointer-events: none;
}

.pd-profile-hero.has-accent::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  width: 220px;
  max-width: 40%;
  height: 4px;
  background: var(--pd-hero-accent);
  transform: skewX(-18deg);
  transform-origin: bottom;
  content: "";
}

.pd-profile-ghost {
  position: absolute;
  top: -30px;
  right: 2%;
  z-index: -1;
  font-size: clamp(190px, 32vw, 460px) !important;
  line-height: 1 !important;
  -webkit-text-stroke: 2px #2a2a2d;
}

.pd-profile-hero-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 36px;
  max-width: var(--pd-max);
  margin: 0 auto;
  padding: 56px var(--pd-gutter) 40px;
  box-sizing: border-box;
}

.pd-profile-avatar {
  position: relative;
  display: flex;
  flex: none;
  align-items: flex-end;
  width: 148px;
  height: 180px;
  padding: 12px;
  box-sizing: border-box;
  overflow: hidden;
  background: #f4f4f1;
  background-position: center;
  background-size: cover;
  color: #0b0b0c;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%);
}

.pd-profile-hero.has-accent .pd-profile-avatar::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 6px;
  background: var(--pd-hero-accent);
  content: "";
}

.pd-profile-avatar-initials { font-size: 64px; }
.pd-profile-avatar.has-image .pd-profile-avatar-initials { visibility: hidden; }

.pd-profile-avatar-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 7px;
  background: #0b0b0c;
  color: var(--pd-yellow);
  font-size: 12px;
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
}

.pd-profile-id {
  display: flex;
  flex: 1 1 480px;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.pd-profile-kicker {
  color: var(--pd-red-hi);
  letter-spacing: 0.36em;
  line-height: 1.6;
}

.pd-profile-name {
  font-size: clamp(64px, 8vw, 128px) !important;
  overflow-wrap: anywhere;
}

.pd-profile-name.is-fitting { overflow-wrap: normal; white-space: nowrap; }

.pd-profile-handle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.pd-profile-handle {
  color: var(--pd-ink);
  font-family: var(--pd-mono);
  font-size: 14px;
  letter-spacing: 0.06em;
}

.pd-profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pd-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding-right: 10px;
  border: 1px solid var(--pd-line);
  color: var(--pd-soft);
  font-family: var(--pd-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pd-profile-badge b {
  display: grid;
  place-items: center;
  align-self: stretch;
  width: 26px;
  background: var(--badge, var(--pd-yellow));
  color: #0b0b0c;
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 900;
  font-size: 12px;
}

.pd-profile-bio {
  max-width: 68ch;
  margin: 0;
  color: var(--pd-soft);
  font-size: 15px;
  line-height: 1.5;
}

.pd-profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pd-profile-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--pd-line);
  color: #c9c9ce;
  font-family: var(--pd-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.pd-profile-chip.is-link:hover { border-color: var(--pd-ink) !important; color: #fff; }
.pd-profile-chip.is-add { border-style: dashed; color: var(--pd-ink); }
.pd-profile-chip.is-add:hover { border-color: var(--pd-red) !important; color: var(--pd-red-hi); }

/* Actions (container keeps .profile-actions for site.js; neutralise legacy rules) */
.pd-profile .pd-profile-actions {
  position: static !important;
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: auto !important;
  grid-template-columns: none !important;
  justify-content: flex-start;
}

.pd-profile-share { width: 48px; height: 48px; }

.pd-profile .pd-profile-follow {
  min-height: 48px;
  height: auto !important;
  padding: 0 30px !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--pd-red) !important;
  color: #fff !important;
  clip-path: var(--pd-slant) !important;
  font-size: 14px !important;
}

.pd-profile .pd-profile-follow:hover { background: #ff2a33 !important; }
.pd-profile .pd-profile-follow.is-following { background: #1f1f22 !important; color: var(--pd-ink) !important; }
.pd-profile .pd-profile-follow.is-following:hover { background: #2c2c30 !important; }
.pd-profile .pd-profile-follow .ui-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; }
.pd-profile .pd-profile-follow[disabled] { opacity: 0.6; cursor: progress; }

/* Stat strip */
.pd-profile-strip {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  max-width: var(--pd-max);
  margin: 0 auto;
  padding: 0 var(--pd-gutter) 36px;
  box-sizing: border-box;
}

.pd-profile-strip .pd-stat strong { font-size: 48px; }
.pd-profile-strip .pd-slash { height: 60px; }

/* ---------- Tabs ---------- */

.pd-profile-tabs {
  max-width: var(--pd-max);
  margin: 0 auto;
  padding: 0 var(--pd-gutter);
  box-sizing: border-box;
}

.pd-profile-tabs .pd-tab { font-size: 15px; }

/* ---------- Body ---------- */

.pd-profile-body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 32px;
  max-width: var(--pd-max);
  margin: 0 auto;
  padding: 40px var(--pd-gutter) 96px;
  box-sizing: border-box;
}

.pd-profile-main {
  flex: 999 1 640px;
  min-width: 0;
}

.pd-profile-pane {
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.pd-profile-aside {
  display: flex;
  flex: 1 1 300px;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.pd-profile-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.pd-profile-head h2 { font-size: 36px !important; }
.pd-profile-count { color: var(--pd-mute); }
.pd-profile-head-links { display: flex; flex-wrap: wrap; gap: 18px; }

.pd-profile .pd-link {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.pd-profile-muted {
  margin: 0;
  color: var(--pd-mute);
  font-size: 14px;
}

.pd-profile-muted:empty { display: none; }

.pd-profile-empty strong { font-size: 22px; color: var(--pd-ink); }
.pd-profile-empty span { color: var(--pd-soft); font-size: 15px; }

/* Cards (telemetry) */
.pd-profile-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  background: var(--pd-panel);
  border: 1px solid var(--pd-line);
}

.pd-profile-card h2 { font-size: 22px !important; }

.pd-profile-telemetry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 24px;
}

.pd-profile-meter {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pd-profile-meter-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  font-size: 15px;
}

.pd-profile-meter-head .pd-m { flex: none; text-align: right; }

/* Posters */
.pd-profile-posters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.pd-profile-poster-skel { aspect-ratio: 4 / 5; }

.pd-profile-poster {
  position: relative;
  min-width: 0;
}

.pd-profile-poster-link {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--pd-ink);
}

.pd-profile-poster-cover {
  display: block;
  aspect-ratio: 4 / 5;
}

.pd-profile-poster-link:hover .pd-profile-poster-cover { filter: brightness(1.08); }
.pd-profile-poster-link:hover .pd-tt { background: var(--pd-red); color: #fff; }

.pd-profile-poster-title {
  position: absolute;
  right: 12px;
  bottom: 20px;
  left: 12px;
  font-size: 22px;
  line-height: 1.15;
}

.pd-profile-poster .list-finish-later-button {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 3;
  display: inline-grid !important;
  place-items: center;
  width: 36px !important;
  height: 36px !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  background: var(--pd-bg) !important;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.pd-profile-poster:hover .list-finish-later-button,
.pd-profile-poster:focus-within .list-finish-later-button,
.pd-profile-poster .list-finish-later-button.is-saved { opacity: 1; }

@media (hover: none) {
  .pd-profile-poster .list-finish-later-button { opacity: 1; }
}

.pd-profile-poster .list-finish-later-button .ui-icon { width: 18px; height: 18px; }
.pd-profile-poster .list-finish-later-button.is-saved { background: var(--pd-red) !important; border-color: var(--pd-red) !important; color: #fff !important; }

.pd-profile-more { display: flex; justify-content: center; margin-top: 28px; }

/* Runs / rivals panels */
.pd-profile-runs-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
}

.pd-profile-runs-head h2 { font-size: 24px !important; }
.pd-profile-rivals .pd-profile-runs-head { padding: 18px 20px; }
.pd-profile-rivals .pd-profile-runs-head h2 { font-size: 20px !important; }

.pd-profile-run {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 13px 20px;
  border-top: 1px solid var(--pd-line-2) !important;
  color: var(--pd-ink);
}

.pd-profile-run:hover { background: #18181a; color: #fff; }
.pd-profile-run-date { width: 70px; flex: none; }
.pd-profile-run-title { flex: 1 1 220px; min-width: 0; font-weight: 800; }
.pd-profile-run-end { width: 60px; flex: none; text-align: right; }

.pd-profile-run-empty {
  margin: 0;
  padding: 16px 20px;
  border-top: 1px solid var(--pd-line-2) !important;
  color: var(--pd-mute);
  font-size: 14px;
}

/* Favorites & saved */
.pd-profile-favs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 16px;
}

.pd-profile-fav {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--pd-panel);
  border: 1px solid var(--pd-line);
  color: var(--pd-ink);
}

.pd-profile-fav:hover { border-color: var(--pd-ink) !important; color: #fff; }
.pd-profile-fav-cover { flex: none; width: 56px; height: 70px; }

.pd-profile-fav-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.pd-profile-fav-title { font-weight: 800; overflow-wrap: anywhere; }

/* Aside */
.pd-profile-season {
  display: block;
  padding: 22px;
  background: var(--pd-yellow);
  color: #0b0b0c !important;
}

.pd-profile-season .pd-m { color: #0b0b0c; }
.pd-profile-season > .pd-m:first-child { letter-spacing: 0.3em; }

.pd-profile-season-big {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 12px 0;
}

.pd-profile-season-big .pd-d { font-size: 64px; }
.pd-profile-season-pts { display: block; font-size: 22px; }

.pd-profile-season-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.pd-profile-season-badges span {
  padding: 4px 8px;
  background: #0b0b0c;
  color: var(--pd-yellow);
  font-family: var(--pd-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pd-profile-season-foot {
  display: block;
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}

a.pd-profile-season:hover { background: #ffe14d; }

.pd-profile-friend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--pd-line-2) !important;
  color: var(--pd-ink);
}

.pd-profile-friend:hover { background: #18181a; color: #fff; }
.pd-profile-friend-avatar.is-red { background-color: var(--pd-red); color: #fff; }

.pd-profile-friend-name {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  font-weight: 700;
}

.pd-profile-friend-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-profile-friend-name small { color: var(--pd-mute); font-size: 11px; font-weight: 500; letter-spacing: 0.06em; }

.pd-profile-reach {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--pd-line);
}

.pd-profile-reach .pd-d { font-size: 44px; }
.pd-profile-reach-copy { color: var(--pd-soft); font-size: 14px; }

/* Stats tab */
.pd-profile-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.pd-profile-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: var(--pd-panel);
  border: 1px solid var(--pd-line);
}

.pd-profile-tile strong { font-size: 40px; }

/* Quests tab */
.pd-profile-questsum {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 18px 20px;
  background: var(--pd-panel);
  border: 1px solid var(--pd-line);
  border-left: 4px solid var(--pd-yellow) !important;
}

.pd-profile-questsum .pd-d { font-size: 36px; color: var(--pd-yellow); }
.pd-profile-questsum .pd-m { flex: 1 1 200px; }

.pd-profile-badgegrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 16px;
}

.pd-profile-badgecard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--pd-panel);
  border: 1px solid var(--pd-line);
}

.pd-profile-badgecard-tier {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 52px;
  background: var(--badge, var(--pd-yellow));
  color: #0b0b0c;
  font-size: 22px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}

.pd-profile-badgecard-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.pd-profile-badgecard-body strong { font-weight: 800; overflow-wrap: anywhere; }

/* Friends tab */
.pd-profile-friendgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 0 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--pd-line-2);
}

.pd-profile-friendgrid .pd-profile-friend { padding: 14px 4px; }

/* ---------- Mobile ---------- */

@media (max-width: 760px) {
  .pd-profile-hero-inner { gap: 22px; padding: 32px var(--pd-gutter) 28px; }
  .pd-profile-avatar { width: 112px; height: 136px; padding: 10px; }
  .pd-profile-avatar-initials { font-size: 48px; }
  .pd-profile-id { flex-basis: 100%; }
  .pd-profile-name { font-size: clamp(40px, 11vw, 64px) !important; }
  .pd-profile-kicker { letter-spacing: 0.22em; }
  .pd-profile-ghost { top: -10px; }
  .pd-profile-strip { gap: 12px 14px; padding-bottom: 28px; }
  .pd-profile-strip .pd-stat strong { font-size: 30px; }
  .pd-profile-strip .pd-stat span { font-size: 10px; letter-spacing: 0.12em; }
  .pd-profile-strip .pd-slash { height: 40px; }
  .pd-profile-tabs { flex-wrap: nowrap; gap: 20px; overflow-x: auto; scrollbar-width: none; }
  .pd-profile-tabs::-webkit-scrollbar { display: none; }
  .pd-profile-tabs .pd-tab { flex: none; font-size: 14px; white-space: nowrap; }
  .pd-profile-body { gap: 28px; padding-top: 28px; padding-bottom: 64px; }
  .pd-profile-pane { gap: 40px; }
  .pd-profile-head h2 { font-size: 28px !important; }
  .pd-profile-posters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .pd-profile-poster-title { right: 8px; bottom: 16px; left: 8px; font-size: 15px; }
  .pd-profile-run { gap: 6px 12px; padding: 12px 16px; }
  .pd-profile-run-title { flex-basis: calc(100% - 140px); }
  .pd-profile-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .pd-profile-tile strong { font-size: 30px; }
}

/* paddock.css forces every border colour; keep inactive tab underlines invisible */
.pd-profile-tabs .pd-tab:not(.is-on) { border-bottom-color: transparent !important; }

/* ---------- Share modal (created by site.js, appended to body) ---------- */

.profile-share-backdrop { background: rgba(5, 5, 6, 0.78) !important; }

.profile-share-modal .profile-share-panel {
  padding: 32px !important;
  border: 1px solid var(--pd-line) !important;
  border-top: 4px solid var(--pd-red) !important;
  background: var(--pd-bg) !important;
  color: var(--pd-ink) !important;
  box-shadow: none !important;
  clip-path: var(--pd-cut) !important;
}

.profile-share-modal .profile-share-close {
  color: var(--pd-ink) !important;
  font-family: var(--pd-mono);
  font-weight: 700;
  font-size: 18px;
}

.profile-share-modal .profile-share-kicker {
  color: var(--pd-red-hi) !important;
  font-family: var(--pd-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.36em;
}

.profile-share-modal .profile-share-panel h2 { font-size: 40px; }

.profile-share-modal .profile-share-url {
  color: var(--pd-soft) !important;
  font-family: var(--pd-mono);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.profile-share-modal .profile-share-grid a,
.profile-share-modal .profile-share-qr button {
  border: 1px solid var(--pd-line) !important;
  border-radius: 0 !important;
  background: var(--pd-panel) !important;
  color: var(--pd-ink) !important;
  font-family: var(--pd-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  clip-path: none !important;
  cursor: pointer;
}

.profile-share-modal .profile-share-grid a:hover,
.profile-share-modal .profile-share-qr button:hover { border-color: var(--pd-ink) !important; color: #fff !important; }

.profile-share-modal .profile-share-qr img {
  border: 0 !important;
  background: #f4f4f1 !important;
  clip-path: var(--pd-cut-sm);
}

.profile-share-modal .profile-copy-link {
  min-height: 48px;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--pd-red) !important;
  color: #fff !important;
  font-family: var(--pd-display);
  font-stretch: 125%;
  font-style: italic;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.03em;
  clip-path: var(--pd-slant) !important;
  cursor: pointer;
}

.profile-share-modal .profile-copy-link:hover { background: #ff2a33 !important; }

/* ---------- P1 shelf, overall taste, taste match ---------- */
.pd-profile-p1s {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.pd-profile-kinds { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.pd-profile-kind { padding: 6px 10px; border: 1px solid var(--pd-line) !important; color: var(--pd-soft); font: 500 11px var(--pd-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.pd-profile-kind b { color: var(--pd-ink); }
.pd-profile-kind.is-top { border-color: var(--pd-red) !important; color: var(--pd-ink); }
.pd-profile-kind.is-top b { color: var(--pd-red-hi); }

.pd-profile-compat { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-left: 6px solid var(--pd-red) !important; }
.pd-profile-compat-big { color: var(--pd-red-hi); font-size: 64px; line-height: 0.95; }
.pd-profile-compat-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 8px; padding-top: 8px; border-top: 1px solid var(--pd-line) !important; }
.pd-profile-compat-line strong { overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
