/* ---------- Pet detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 14px; border-radius: 8px; }
.back:hover { color: var(--text); }
.back svg { width: 16px; height: 16px; }

.pd-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; min-height: 36px; }
.pd-pager { display: flex; gap: 8px; min-width: 0; }
.pd-pager a {
  display: inline-flex; align-items: center; gap: 6px; max-width: 220px;
  height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface);
  color: var(--text-2); text-decoration: none; font-size: 13px; font-weight: 600;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pd-pager a:hover { color: var(--text); background: var(--surface-2); border-color: rgba(255, 255, 255, 0.18); }
.pd-pager a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-pager a svg { width: 15px; height: 15px; flex-shrink: 0; }
.pd-pager [data-next] svg { transform: rotate(180deg); }

/* Hero: title, numbers and chart on the left; art and actions on the right */
.pd-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas: 'main side' 'chart side';
  grid-template-rows: auto 1fr;
  column-gap: 32px; row-gap: 24px;
  align-items: start;
}
.pd-main { grid-area: main; min-width: 0; }
.pd-side { grid-area: side; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 88px; }
.pd-chart-slot { grid-area: chart; min-width: 0; }

.pd-head h1 {
  font-size: clamp(30px, 4.6vw, 52px); font-weight: 800; line-height: 1.02; letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}
.pd-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.pd-tags .rarity { font-size: 12.5px; padding: 4px 11px 4px 10px; }
.pd-tags .vtag { font-size: 11px; padding: 4px 9px; }
.pd-rank {
  font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums;
  padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2);
}
.pd-rank span { color: var(--muted); font-weight: 600; }

.pd-figures { display: flex; align-items: stretch; margin-top: 28px; }
.pd-fig { min-width: 0; }
.pd-fig-2 { margin-left: 32px; padding-left: 32px; border-left: 1px solid var(--line-2); }
.pd-label { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.pd-big {
  font: 900 clamp(48px, 7vw, 76px)/0.95 var(--font-display);
  letter-spacing: -0.045em; font-variant-numeric: tabular-nums;
  min-height: 0.95em; display: flex; align-items: center;
}
.pd-big-2 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; color: var(--text-2); height: clamp(48px, 7vw, 76px); }
.pd-big-oc .val-oc { font-size: clamp(26px, 3.6vw, 38px); padding: 10px 16px 9px; border-radius: 12px; letter-spacing: 0.04em; box-shadow: 0 0 40px -10px rgba(255, 170, 60, 0.7); }
.pd-big-none { font-size: clamp(32px, 4.6vw, 48px); font-weight: 800; color: var(--muted); letter-spacing: -0.035em; height: clamp(48px, 7vw, 76px); }

.pd-delta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; font-size: 14.5px; }
.pd-chg { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pd-chg svg { width: 11px; height: 11px; }
.pd-chg.up { color: var(--win); }
.pd-chg.down { color: var(--lose); }
.pd-chg.flat { color: var(--muted); }
.pd-chg-abs { margin-left: 6px; }
.pd-chg-when { color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.pd-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; opacity: 0.8; flex-shrink: 0; }

/* Art + actions */
.pd-art {
  padding: 28px; border-radius: 22px;
  background:
    radial-gradient(80% 70% at 50% 40%, color-mix(in srgb, var(--rc) 14%, transparent), transparent 70%),
    var(--inset);
  border: 1px solid var(--line);
}
.pd-art .art { width: 100%; border-radius: 20px; padding: 3px; }
.pd-art .art-inner { border-radius: 17px; }
.pd-art .art.v-rainbow { padding: 4px; }
.pd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pd-actions .btn { height: 46px; font-size: 14.5px; min-width: 0; }
.pd-actions .btn-primary { grid-column: 1 / -1; font-weight: 700; }

/* Chart card */
.pd-chart-card { padding: 20px 20px 16px; }
.pd-chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pd-chart-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.pd-chart-delta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 13.5px; min-height: 20px; }
.pd-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.pd-tabs button {
  height: 30px; min-width: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 700; transition: color 0.15s, background 0.15s;
}
.pd-tabs button:hover { color: var(--text); }
.pd-tabs button[aria-pressed='true'] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

.pd-plot { position: relative; touch-action: pan-y; border-radius: 10px; cursor: crosshair; -webkit-user-select: none; user-select: none; }
.pd-plot svg { display: block; overflow: visible; }
.pd-grid line { stroke: rgba(255, 255, 255, 0.07); stroke-dasharray: 2 5; }
.pd-axis text { fill: var(--muted); font: 500 11.5px var(--font); font-variant-numeric: tabular-nums; }
.pd-line { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 4px 10px rgba(47, 140, 255, 0.25)); }
.pd-area { fill: url(#pdGrad); }
.pd-end { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.pd-end-halo { fill: rgba(47, 140, 255, 0.18); }
.pd-cross { stroke: rgba(255, 255, 255, 0.28); stroke-dasharray: 3 3; }
.pd-hdot { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.pd-tip {
  position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2;
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  background: var(--surface-3); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 8px 12px; font-size: 12px; color: var(--text-2);
  box-shadow: var(--shadow); white-space: nowrap;
  transform: translate(-50%, calc(-100% - 14px));
  opacity: 0; transition: opacity 0.12s;
}
.pd-tip.below { transform: translate(-50%, 14px); }
.pd-tip.show { opacity: 1; }
.pd-tip b { font: 800 16px/1.1 var(--font-display); color: var(--text); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pd-tip .pd-chg { font-size: 12px; }
.pd-chart-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.pd-note { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.pd-table-btn {
  border: 0; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600;
  padding: 6px 10px; margin-right: -10px; border-radius: 8px; flex-shrink: 0;
}
.pd-table-btn:hover { color: var(--text); background: var(--surface-2); }
.pd-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 8px; }
.pd-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.pd-table td { padding: 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.pd-table tr:last-child td { border-bottom: 0; }
.pd-table th:last-child, .pd-table td:last-child { text-align: right; }

.pd-chart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 220px; padding: 24px; border-radius: 14px;
  border: 1px dashed var(--line-2); color: var(--muted); font-size: 13.5px;
  background: repeating-linear-gradient(0deg, transparent 0 43px, rgba(255, 255, 255, 0.03) 43px 44px);
}
.pd-chart-empty svg { width: 120px; height: 40px; margin-bottom: 8px; }
.pd-chart-empty path { fill: none; stroke: var(--line-2); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 4 6; }
.pd-chart-empty b { color: var(--text-2); font-size: 15px; }
.pd-chart-empty span { max-width: 36ch; }

/* Stat strip */
.pd-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: 32px; }
.pd-stat {
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  padding: 16px 18px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
}
.pd-stat-k { font-size: 13px; font-weight: 600; color: var(--text-2); }
.pd-stat-v {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font: 800 21px/1.15 var(--font-display); letter-spacing: -0.025em; font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.pd-stat-v.is-empty { color: var(--muted); font-weight: 700; }
.pd-stat-v .val { font-weight: 800; }
.pd-stat-v .val-oc { font-size: 13px; }
.pd-stat-v .val-none { font-size: inherit; font-weight: 700; }
.pd-stat-v .trend { font-size: inherit; font-weight: 800; gap: 8px; }
.pd-stat-v .trend .tdot { width: 8px; height: 8px; }
.pd-approx { font: 600 11px var(--font); letter-spacing: 0; color: var(--muted); padding: 2px 6px; border-radius: 6px; background: var(--surface-2); }
.pd-rdot { width: 9px; height: 9px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 10px var(--rc); flex-shrink: 0; }

/* Sections */
.pd-section { margin-top: 40px; }
.pd-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.pd-section-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }
.pd-section-head > span, .pd-rail-nav > span { font-size: 13.5px; color: var(--muted); }

/* Variants */
.pd-vars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pd-var {
  display: grid; grid-template-columns: 72px minmax(0, 1fr); grid-template-rows: 1fr auto auto 1fr;
  column-gap: 14px; row-gap: 4px; padding: 10px;
  border-radius: var(--radius); text-decoration: none; min-width: 0;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.pd-var > .art, .pd-var-ph { grid-row: 1 / -1; grid-column: 1; width: 72px; }
.pd-var .art { border-radius: 13px; }
.pd-var .art-inner { border-radius: 11px; }
.pd-var-name { grid-column: 2; grid-row: 2; }
.pd-var-val { grid-column: 2; grid-row: 3; }
a.pd-var:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--rc) 45%, transparent); transform: translateY(-2px); }
.pd-var.is-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 14px 34px -20px rgba(47, 140, 255, 0.6); }
.pd-var.is-current:hover { border-color: var(--accent); }
.pd-var-name { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.pd-var-here { font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); padding: 2px 7px; border-radius: 999px; }
.pd-var-val { font-size: 20px; line-height: 1.2; min-height: 24px; display: flex; align-items: center; }
.pd-var-val .val { font-weight: 800; letter-spacing: -0.02em; }
.pd-var-val .val-none { font-size: 14px; }
.pd-var.is-missing { background: transparent; border-style: dashed; border-color: var(--line-2); }
.pd-var-ph {
  aspect-ratio: 1; border-radius: 13px;
  border: 1.5px dashed rgba(255, 255, 255, 0.09);
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(255, 255, 255, 0.018) 10px 20px);
}
.pd-var.is-missing .pd-var-name { color: var(--muted); }
.pd-var.is-missing .pd-var-val { font-size: 14px; font-weight: 600; color: var(--muted); opacity: 0.7; }

/* Similar pets rail */
.pd-rail-nav { display: flex; align-items: center; gap: 8px; }
.pd-rail-nav > span { margin-right: 6px; }
.pd-rail-btn {
  width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface);
  display: grid; place-items: center; padding: 0; color: var(--text-2);
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.pd-rail-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.pd-rail-btn:disabled { opacity: 0.35; cursor: default; }
.pd-rail-btn svg { width: 16px; height: 16px; }
.pd-rail-btn[data-rail='1'] svg { transform: rotate(180deg); }
.pd-rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 196px; gap: 14px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  padding: 6px 2px 14px; margin: -6px -2px 0;
  scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent;
}
.pd-rail > * { scroll-snap-align: start; min-width: 0; }

/* Unknown pet */
.pd-missing { max-width: 560px; margin: 24px auto 0; padding: 40px 28px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pd-missing-art {
  width: 96px; height: 96px; border-radius: 24px; display: grid; place-items: center; margin-bottom: 8px;
  font: 900 44px/1 var(--font-display); color: var(--muted);
  border: 1.5px dashed var(--line-2); background: var(--inset);
}
.pd-missing h1 { font-size: 30px; font-weight: 800; }
.pd-missing p { margin: 0; color: var(--text-2); max-width: 42ch; overflow-wrap: anywhere; }
.pd-missing b { color: var(--text); }
.pd-missing-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }

/* ---------- Share card dialog ---------- */
.sc-modal { width: min(480px, 100%); max-height: min(920px, calc(100vh - 40px)); }
.sc-backdrop { padding-top: 20px; align-items: center; }
.sc-body { overflow-y: auto; padding: 18px 18px 18px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.sc-stage {
  position: relative; aspect-ratio: 800 / 1100; width: min(100%, calc((100vh - 260px) * 800 / 1100)); margin: 0 auto;
  min-width: 200px; display: grid; place-items: center;
}
.sc-stage::before {
  content: ''; position: absolute; inset: 8% 4%; border-radius: 40px; z-index: 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rc) 35%, transparent), transparent);
  filter: blur(30px); opacity: 0.7; pointer-events: none;
}
.sc-img { position: relative; z-index: 1; width: 100%; height: auto; display: block; animation: sc-in 0.35s var(--ease); filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.55)); }
@keyframes sc-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
.sc-loading {
  position: relative; z-index: 1; width: 100%; height: 100%; border-radius: 6%;
  border: 1px solid var(--line-2);
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%) 0 0 / 300% 100%;
  animation: sc-shimmer 1.2s linear infinite;
}
@keyframes sc-shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.sc-error { position: relative; z-index: 1; padding: 24px; text-align: center; color: var(--text-2); border: 1px dashed var(--line-3); border-radius: 18px; }
.sc-hint { margin: 0; text-align: center; color: var(--muted); font-size: 13px; }
.sc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sc-actions .btn { height: 46px; min-width: 0; }
.sc-actions .btn-primary { grid-column: 1 / -1; font-weight: 700; }
.sc-actions .btn[disabled] { opacity: 0.5; cursor: default; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .pd-vars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pd-hero { grid-template-columns: minmax(0, 1fr) 300px; column-gap: 24px; }
}
@media (max-width: 860px) {
  .pd-hero {
    grid-template-columns: 148px minmax(0, 1fr);
    grid-template-areas: 'art head' 'fig fig' 'delta delta' 'act act' 'chart chart';
    grid-template-rows: none;
    column-gap: 18px; row-gap: 0;
    align-items: center;
  }
  .pd-main, .pd-side { display: contents; }
  .pd-head { grid-area: head; min-width: 0; }
  .pd-art { grid-area: art; padding: 12px; border-radius: 20px; }
  .pd-art .art { border-radius: 14px; padding: 2px; }
  .pd-art .art-inner { border-radius: 12px; }
  .pd-figures { grid-area: fig; margin-top: 26px; }
  .pd-delta { grid-area: delta; margin-top: 12px; }
  .pd-actions { grid-area: act; margin-top: 22px; grid-template-columns: 1fr 1fr; }
  .pd-chart-slot { grid-area: chart; margin-top: 22px; }
  .pd-head h1 { font-size: clamp(26px, 6.4vw, 40px); }
}
@media (max-width: 600px) {
  .sc-backdrop { padding: 0; align-items: flex-end; }
  .sc-modal { height: auto; max-height: 94vh; }
  .sc-body { padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); gap: 12px; }
  .sc-stage { width: min(100%, calc((94vh - 230px) * 800 / 1100)); }
  .sc-actions .btn { height: 44px; padding: 0 10px; }
  .pd-top { margin-bottom: 16px; }
  .pd-pager a { padding: 0; width: 36px; justify-content: center; }
  .pd-pager a span { display: none; }
  .pd-hero { grid-template-columns: 104px minmax(0, 1fr); column-gap: 14px; }
  .pd-art { padding: 8px; border-radius: 18px; }
  .pd-tags { margin-top: 8px; gap: 6px; }
  .pd-tags .rarity { font-size: 11.5px; padding: 3px 9px 3px 8px; }
  .pd-tags .vtag { font-size: 10px; padding: 3px 7px; }
  .pd-rank { font-size: 11.5px; padding: 2px 8px; }
  .pd-figures { margin-top: 22px; }
  .pd-fig-2 { margin-left: 20px; padding-left: 20px; }
  .pd-label { font-size: 13px; margin-bottom: 6px; }
  .pd-big { font-size: 52px; }
  .pd-big-2, .pd-big-none { font-size: 30px; height: 52px; }
  .pd-delta { font-size: 13.5px; }
  .pd-actions .btn { height: 44px; padding: 0 10px; }
  .pd-chart-card { padding: 16px 14px 12px; border-radius: 16px; }
  .pd-chart-head { flex-direction: column; align-items: stretch; }
  .pd-tabs { display: grid; grid-template-columns: repeat(4, 1fr); }
  .pd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
  .pd-stat { padding: 14px 14px 15px; gap: 8px; border-radius: 14px; }
  .pd-stat-k { font-size: 12.5px; }
  .pd-stat-v { font-size: 18px; }
  .pd-section { margin-top: 32px; }
  .pd-section-head { margin-bottom: 12px; }
  .pd-section-head h2 { font-size: 19px; }
  .pd-section-head > span { font-size: 12.5px; text-align: right; }
  .pd-rail-nav > span, .pd-rail-btn { display: none; }
  .pd-vars { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .pd-var { display: flex; flex-direction: column; padding: 6px 6px 10px; border-radius: 14px; gap: 4px; }
  .pd-var > .art, .pd-var-ph { width: 100%; margin-bottom: 4px; }
  .pd-var-name { font-size: 11.5px; padding: 0 2px; }
  .pd-var .art { border-radius: 11px; }
  .pd-var .art-inner { border-radius: 9px; }
  .pd-var-here { display: none; }
  .pd-var-val { font-size: 14.5px; padding: 0 2px; min-height: 20px; }
  .pd-var-val .val-none, .pd-var.is-missing .pd-var-val { font-size: 11.5px; }
  .pd-var-ph { border-radius: 10px; }
  .pd-rail { grid-auto-columns: 158px; gap: 10px; margin: -6px -16px 0; padding: 6px 16px 12px; scroll-padding: 0 16px; }
}
@media (max-width: 360px) {
  .pd-big { font-size: 44px; }
  .pd-hero { grid-template-columns: 88px minmax(0, 1fr); }
}

/* Variant previews for variants that aren't listed */
.pd-var.is-preview { cursor: pointer; text-align: left; font: inherit; color: inherit; border-style: dashed; }
.pd-var.is-preview .art { opacity: 0.75; transition: opacity 0.2s; }
.pd-var.is-preview:hover .art, .pd-var.is-preview[aria-pressed='true'] .art { opacity: 1; }
.pd-var.is-preview[aria-pressed='true'] { border-style: solid; border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 1px rgba(47, 140, 255, 0.4); }
.pd-var-prev {
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); background: rgba(47, 140, 255, 0.12); border: 1px solid rgba(47, 140, 255, 0.3);
  padding: 2px 6px; border-radius: 999px;
}
.pd-art.is-previewing { position: relative; }
.pd-art.is-previewing::after {
  content: 'PREVIEW'; position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 5;
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em; color: #fff;
  padding: 4px 10px; border-radius: 999px; background: rgba(47, 140, 255, 0.85);
}
.pd-preview-note { margin-top: 10px; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.pd-preview-note[hidden] { display: none; }
.pd-preview-off { margin-left: 4px; background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; cursor: pointer; }
.pd-preview-off:hover { text-decoration: underline; }

/* ---------- Mood backdrop ---------- */
/* A huge blurred copy of the pet fills the top of the page with its colours; particles drift over it. */
main:has(> #app > .pd) { overflow-x: clip; }
.pd { position: relative; isolation: isolate; }
.pd-mood {
  position: absolute; z-index: -1; pointer-events: none; overflow: hidden;
  top: -32px; left: 50%; width: 100vw; margin-left: -50vw;
  height: min(1000px, 125vh);
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 38%, rgba(0, 0, 0, 0.45) 70%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0, #000 38%, rgba(0, 0, 0, 0.45) 70%, transparent 100%);
}
.pd-mood::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(55% 60% at 72% 18%, color-mix(in srgb, var(--rc) 16%, transparent), transparent 70%),
    radial-gradient(45% 50% at 12% 0%, color-mix(in srgb, var(--rc) 9%, transparent), transparent 70%);
}
.pd-mood img {
  position: absolute; aspect-ratio: 1; object-fit: contain; max-width: none;
  filter: blur(var(--mb, 72px)) saturate(1.9);
  opacity: 0.55; transform: translateZ(0);
}
.pd-mood-a { width: min(1050px, 92vw); right: max(-10vw, calc(50% - 760px)); top: -32%; }
.pd-mood-b { width: min(820px, 70vw); left: max(-18vw, calc(50% - 900px)); top: -22%; opacity: 0.26 !important; transform: scaleX(-1) rotate(-14deg); }
/* Keeps headline text readable over bright pets. */
.pd-mood::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11, 15, 25, 0.38), rgba(11, 15, 25, 0.06) 55%, rgba(11, 15, 25, 0.12));
}
.pd-mood.v-golden img { filter: blur(var(--mb, 72px)) sepia(0.85) saturate(2.6) hue-rotate(-12deg) brightness(1.05); }
.pd-mood.v-diamond img { filter: blur(var(--mb, 72px)) grayscale(1) brightness(0.65) sepia(1) hue-rotate(190deg) saturate(7) contrast(1.2) brightness(1.1); }
.pd-mood.v-rainbow img { filter: blur(var(--mb, 72px)) saturate(2) hue-rotate(40deg); }
.pd-mood.v-rainbow .pd-mood-b { filter: blur(var(--mb, 72px)) saturate(2) hue-rotate(200deg); opacity: 0.34 !important; }
.pd-mood.v-rainbow::before {
  background: conic-gradient(from 200deg at 70% 10%, rgba(255, 80, 120, 0.12), rgba(255, 200, 60, 0.1), rgba(80, 255, 160, 0.1), rgba(70, 160, 255, 0.12), rgba(190, 90, 255, 0.12), rgba(255, 80, 120, 0.12));
}
.pd-mood.v-diamond::before { background: radial-gradient(55% 60% at 72% 18%, rgba(143, 227, 255, 0.16), transparent 70%), radial-gradient(45% 50% at 12% 0%, rgba(143, 227, 255, 0.08), transparent 70%); }
.pd-mood.v-golden::before { background: radial-gradient(55% 60% at 72% 18%, rgba(255, 196, 68, 0.16), transparent 70%), radial-gradient(45% 50% at 12% 0%, rgba(255, 196, 68, 0.08), transparent 70%); }
.pd-mood-fx { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
/* Let the tint show through the hero art well and the pager pills. */
.pd .pd-art { background: radial-gradient(80% 70% at 50% 40%, color-mix(in srgb, var(--rc) 16%, transparent), transparent 70%), rgba(10, 14, 24, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

@media (max-width: 860px) {
  .pd-mood { --mb: 48px; height: min(760px, 110vh); top: -24px; }
  .pd-mood-a { width: 120vw; right: -40vw; top: -18%; }
  .pd-mood-b { width: 90vw; left: -40vw; top: 4%; }
}

/* ---------- Owner's choice showcase ---------- */
.pd-oc {
  position: relative; overflow: hidden; padding: 0;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 340px;
  background:
    radial-gradient(120% 90% at 25% 0%, color-mix(in srgb, var(--oc, var(--rc)) 10%, transparent), transparent 60%),
    linear-gradient(180deg, #0f1421, #090c14);
  border-color: color-mix(in srgb, var(--oc, var(--rc)) 28%, var(--line));
  box-shadow: 0 30px 70px -40px color-mix(in srgb, var(--oc, var(--rc)) 55%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.pd-oc.v-golden { --oc: #ffc444; --oc-2: #fff1c2; --oc-3: #c98a1e; }
.pd-oc.v-diamond { --oc: #8fe3ff; --oc-2: #f2fdff; --oc-3: #58b8e0; }
.pd-oc.v-rainbow { --oc: #c89bff; }
.pd-oc { --oc-2: #ffffff; --oc-3: var(--oc, var(--rc)); }

/* Stage: a single spotlight from above onto a plinth */
.pd-oc-stage { position: relative; min-height: 340px; overflow: hidden; }
.pd-oc-beam { position: absolute; inset: 0; filter: blur(10px); }
.pd-oc-beam i {
  position: absolute; left: 50%; top: -8%; width: 92%; height: 100%; transform: translateX(-50%);
  clip-path: polygon(41% 0, 59% 0, 92% 100%, 8% 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), color-mix(in srgb, var(--oc, var(--rc)) 14%, transparent) 55%, transparent 88%);
  animation: oc-beam 6s ease-in-out infinite alternate;
}
.pd-oc-stage::before {
  /* The lamp */
  content: ''; position: absolute; left: 50%; top: -18px; width: 110px; height: 36px; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(closest-side, #fff, rgba(255, 255, 255, 0.4) 40%, transparent);
  z-index: 1;
}
.pd-oc-pool {
  position: absolute; left: 50%; bottom: 46px; width: 78%; height: 70px; transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.28), color-mix(in srgb, var(--oc, var(--rc)) 22%, transparent) 55%, transparent);
}
.pd-oc-piece {
  position: absolute; left: 50%; bottom: 62px; width: min(62%, 230px); aspect-ratio: 1; transform: translateX(-50%);
  display: grid; place-items: center; z-index: 2;
  animation: oc-float 5s ease-in-out infinite;
}
.pd-oc-piece::after {
  /* contact shadow */
  content: ''; position: absolute; left: 22%; right: 22%; bottom: -6px; height: 14px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.7), transparent); z-index: -1;
  animation: oc-shadow 5s ease-in-out infinite;
}
.pd-oc-img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 30px color-mix(in srgb, var(--oc, var(--rc)) 35%, transparent)); }
.pd-oc-img.v-golden { filter: sepia(0.85) saturate(2.4) hue-rotate(-12deg) brightness(1.08) contrast(1.05) drop-shadow(0 14px 24px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 28px rgba(255, 196, 68, 0.45)); }
.pd-oc-img.v-diamond { filter: grayscale(1) brightness(0.65) sepia(1) hue-rotate(190deg) saturate(7) contrast(1.2) brightness(1.1) drop-shadow(0 14px 24px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 28px rgba(143, 227, 255, 0.45)); }
.pd-oc-img.v-rainbow { filter: saturate(1.6) drop-shadow(0 14px 24px rgba(0, 0, 0, 0.6)); animation: rainbow-hue 6s linear infinite; }
.pd-oc-piece .art { width: 100%; }
.pd-oc-plinth {
  position: absolute; left: 50%; bottom: 0; width: 72%; height: 54px; transform: translateX(-50%);
  border-radius: 10px 10px 0 0; z-index: 1;
  background: linear-gradient(180deg, #252c3d, #141926 40%, #0d111b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 -10px 30px -12px color-mix(in srgb, var(--oc, var(--rc)) 40%, transparent);
  display: grid; place-items: center;
}
.pd-oc-plinth::before {
  content: ''; position: absolute; left: -5%; right: -5%; top: 0; height: 8px; border-radius: 6px;
  background: linear-gradient(180deg, #343c50, #1b2130); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.pd-oc-plinth span {
  margin-top: 8px; max-width: 86%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: color-mix(in srgb, var(--oc-2) 70%, #8a93a6);
  padding: 3px 10px; border-radius: 3px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--oc-3) 22%, #1c2232), color-mix(in srgb, var(--oc-3) 8%, #12161f));
  border: 1px solid color-mix(in srgb, var(--oc-3) 30%, transparent);
}

/* Plaque */
.pd-oc-plaque {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 0; min-width: 0;
  padding: 30px 30px 30px 8px;
}
.pd-oc-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase;
  color: color-mix(in srgb, var(--oc, var(--rc)) 80%, #fff);
}
.pd-oc-eyebrow i { width: 22px; height: 1px; background: currentColor; opacity: 0.7; }
.pd-oc-title {
  margin-top: 12px; font-size: 15px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text);
  line-height: 1.35; overflow-wrap: anywhere;
}
.pd-oc-serial {
  margin-top: 10px; display: flex; align-items: baseline; gap: 2px;
  font: 900 clamp(76px, 9vw, 112px)/0.92 var(--font-display); letter-spacing: -0.055em; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--oc-2) 8%, color-mix(in srgb, var(--oc, var(--rc)) 85%, #fff) 52%, var(--oc-3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 8px 26px color-mix(in srgb, var(--oc, var(--rc)) 35%, transparent));
  padding-bottom: 4px;
}
.pd-oc.v-rainbow .pd-oc-serial {
  background: linear-gradient(100deg, #ff6b8b, #ffc65a 25%, #6bffb0 50%, #63b4ff 75%, #c38bff);
  -webkit-background-clip: text; background-clip: text;
}
.pd-oc-hash { font-size: 0.55em; letter-spacing: 0; margin-right: 4px; opacity: 0.85; align-self: flex-start; margin-top: 0.12em; }
.pd-oc-of { font-size: 0.3em; font-weight: 700; letter-spacing: 0.04em; margin: 0 12px; color: var(--muted); -webkit-text-fill-color: var(--muted); text-transform: uppercase; }
.pd-oc-sub { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }
.pd-oc-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
.pd-oc-tags .rarity { font-size: 12.5px; padding: 4px 11px 4px 10px; }
.pd-oc-note {
  margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 13.5px; line-height: 1.55; color: var(--muted); max-width: 44ch;
}

@keyframes oc-float { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -8px); } }
@keyframes oc-shadow { 0%, 100% { opacity: 1; transform: scaleX(1); } 50% { opacity: 0.6; transform: scaleX(0.85); } }
@keyframes oc-beam { from { opacity: 0.85; } to { opacity: 1; } }

@media (max-width: 600px) {
  .pd-oc { grid-template-columns: 1fr; min-height: 0; border-radius: 18px; }
  .pd-oc-stage { min-height: 280px; }
  .pd-oc-piece { width: 190px; }
  .pd-oc-plaque { padding: 4px 20px 22px; text-align: left; }
  .pd-oc-serial { font-size: 88px; }
}
@media (prefers-reduced-motion: reduce) {
  .pd-oc-piece, .pd-oc-piece::after, .pd-oc-beam i { animation: none; }
  .pd-oc-img.v-rainbow { animation: none; filter: saturate(1.6) hue-rotate(40deg) drop-shadow(0 14px 24px rgba(0, 0, 0, 0.6)); }
}
.pd-actions .pd-compare { grid-column: 1 / -1; }

/* Watch toggle (watchlist star) sits next to Compare */
.pd-actions .pd-watch + .pd-compare { grid-column: auto; }
.fav-watch svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; transition: fill 0.18s, transform 0.25s var(--ease); }
.fav-watch[aria-pressed='true'] {
  color: var(--gold);
  border-color: color-mix(in srgb, var(--gold) 45%, transparent);
  background: color-mix(in srgb, var(--gold) 11%, var(--surface));
  box-shadow: 0 6px 22px -10px color-mix(in srgb, var(--gold) 70%, transparent);
}
.fav-watch[aria-pressed='true'] svg { fill: currentColor; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--gold) 70%, transparent)); }
.fav-watch[aria-pressed='true']:hover { background: color-mix(in srgb, var(--gold) 16%, var(--surface-2)); }
.fav-watch.fav-pop svg { animation: fav-pop 0.42s cubic-bezier(0.3, 1.6, 0.5, 1); }
@media (prefers-reduced-motion: reduce) { .fav-watch.fav-pop svg { animation: none; } }

/* ---------- Mutations ---------- */
.pd-muts { margin-top: 16px; }
.pd-muts:empty { display: none; }
.pd-muts { display: flex; gap: 6px; flex-wrap: wrap; }
.pd-muts .mut-chip small { margin-left: 2px; }
.pd-mut-info { margin-top: 16px; max-width: 560px; }
.pd-mut-info[hidden] { display: none; }
.pd-delta .mut-badge { vertical-align: middle; }
@media (max-width: 860px) {
  .pd-hero { grid-template-areas: 'art head' 'muts muts' 'fig fig' 'delta delta' 'minfo minfo' 'act act' 'chart chart'; }
  .pd-muts { grid-area: muts; margin-top: 18px; }
  .pd-mut-info { grid-area: minfo; max-width: none; }
}
@media (max-width: 600px) {
  /* one swipeable row of chips on phones */
  .pd-muts {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin: 16px -16px 0; padding: 2px 16px;
    scroll-padding: 0 16px;
    -webkit-mask: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 24px), transparent);
    mask: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 24px), transparent);
  }
  .pd-muts::-webkit-scrollbar { display: none; }
  .pd-muts .mut-chip { flex: none; }
}
