/* Widok profilu - wspólny dla strony i launchera. Kolory z motywu, a gdy ich brak (strona), z wartości domyślnych. */
.pv-root {
  --pv-card: var(--bg-card, rgba(255, 255, 255, 0.05));
  --pv-border: var(--border, rgba(255, 255, 255, 0.1));
  --pv-text: var(--text, #f5f5f7);
  --pv-muted: var(--text-muted, rgba(235, 235, 245, 0.6));
  --pv-accent: var(--accent, #ff375f);
  --pv-radius: 18px;
  --cell: 12px;
  --gap: 3px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--pv-text);
}

.pv-hero {
  position: relative;
  border-radius: var(--pv-radius);
  overflow: hidden;
  border: 1px solid var(--pv-border);
  background: var(--pv-card);
}

.pv-banner {
  position: relative;
  height: 150px;
}

.pv-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.35));
}

.pv-head {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 18px;
  padding: 0 22px 18px;
  margin-top: -110px;
}

.pv-avatar {
  flex: 0 0 170px;
  height: 250px;
  position: relative;
  z-index: 1;
}

.pv-avatar canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.pv-ident {
  padding-bottom: 6px;
  min-width: 0;
}

.pv-ident h1 {
  margin: 0 0 6px;
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  word-break: break-all;
}

.pv-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px 3px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--pv-border);
}

.pv-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7280;
}

.pv-status.is-online i {
  background: #4ade80;
  box-shadow: 0 0 10px #4ade80;
}

.pv-bio {
  margin: 10px 0 0;
  color: var(--pv-text);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pv-member {
  margin: 6px 0 0;
  color: var(--pv-muted);
  font-size: 0.8rem;
}

.pv-link {
  border: 0;
  background: none;
  color: var(--pv-accent);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.pv-bio-input {
  flex: 1 1 260px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--pv-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--pv-text);
  font: inherit;
}

.pv-btn,
.pv-edit-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.pv-edit-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.pv-btn:hover,
.pv-edit-btn:hover {
  background: var(--pv-accent);
  border-color: transparent;
}

.pv-banner-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  padding: 0 22px 18px;
}

.pv-banner-picker[hidden] {
  display: none;
}

.pv-banner-opt {
  height: 46px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.pv-banner-opt:hover {
  transform: translateY(-2px);
}

.pv-banner-opt.is-active {
  border-color: #fff;
}

.pv-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.pv-stat {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--pv-border);
  background: var(--pv-card);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pv-stat b {
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}

.pv-stat span {
  color: var(--pv-muted);
  font-size: 0.8rem;
}

.pv-card {
  padding: 16px 18px;
  border-radius: var(--pv-radius);
  border: 1px solid var(--pv-border);
  background: var(--pv-card);
  min-width: 0;
}

.pv-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.pv-card h3 small {
  color: var(--pv-muted);
  font-weight: 500;
  margin-left: 6px;
}

.pv-empty,
.pv-sub {
  color: var(--pv-muted);
  font-size: 0.85rem;
  margin: 0;
}

.pv-sub {
  margin: 12px 0 8px;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* wykres aktywności */
.pv-heat-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.pv-heat {
  --cell: 12px;
  --gap: 3px;
  width: max-content;
}

.pv-heat-months {
  position: relative;
  height: 16px;
  margin-left: 30px;
  font-size: 0.7rem;
  color: var(--pv-muted);
}

.pv-heat-months span {
  position: absolute;
  left: calc(var(--w) * (var(--cell) + var(--gap)));
}

.pv-heat-body {
  display: flex;
  gap: 6px;
}

.pv-heat-days {
  display: grid;
  grid-template-rows: repeat(7, var(--cell));
  gap: var(--gap);
  width: 24px;
  font-size: 0.65rem;
  color: var(--pv-muted);
  line-height: var(--cell);
}

.pv-heat-grid {
  display: flex;
  gap: var(--gap);
}

.pv-week {
  display: grid;
  grid-template-rows: repeat(7, var(--cell));
  gap: var(--gap);
}

.pv-day {
  display: inline-block;
  width: var(--cell);
  height: var(--cell);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
}

.pv-day.is-future {
  background: transparent;
}

.pv-day.l1 { background: color-mix(in srgb, var(--pv-accent) 28%, transparent); }
.pv-day.l2 { background: color-mix(in srgb, var(--pv-accent) 52%, transparent); }
.pv-day.l3 { background: color-mix(in srgb, var(--pv-accent) 76%, transparent); }
.pv-day.l4 { background: var(--pv-accent); box-shadow: 0 0 6px color-mix(in srgb, var(--pv-accent) 60%, transparent); }

.pv-heat-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--pv-muted);
}

/* kolekcja */
.pv-rarity-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pv-rarity-count {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--rarity);
  background: color-mix(in srgb, var(--rarity) 15%, transparent);
}

.pv-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pv-items-all {
  margin-top: 12px;
}

.pv-item {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--rarity) 45%, transparent);
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--rarity) 30%, transparent), transparent 70%), rgba(0, 0, 0, 0.2);
}

.pv-item img {
  width: 38px;
  height: 38px;
  image-rendering: pixelated;
  object-fit: contain;
}

.pv-items-all .pv-item {
  width: 40px;
  height: 40px;
}

.pv-items-all .pv-item img {
  width: 30px;
  height: 30px;
}

/* zrzuty */
.pv-shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.pv-shot {
  position: relative;
  padding: 0;
  border: 1px solid var(--pv-border);
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 16 / 9;
  background: #000;
}

.pv-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.pv-shot:hover img {
  transform: scale(1.04);
}

.pv-shot-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.pv-shot:hover .pv-shot-del {
  opacity: 1;
}

.pv-shot-del:hover {
  background: #e11d48;
}

.pv-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.88);
}

.pv-lightbox[hidden] {
  display: none;
}

.pv-lightbox img {
  max-width: 90vw;
  max-height: 86vh;
  border-radius: 10px;
}

.pv-lb-nav,
.pv-lb-close {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(20, 20, 26, 0.7);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.pv-lb-nav:hover,
.pv-lb-close:hover {
  background: var(--pv-accent);
}

.pv-lb-nav.prev { left: 3vw; top: 50%; margin-top: -24px; }
.pv-lb-nav.next { right: 3vw; top: 50%; margin-top: -24px; }
.pv-lb-close { right: 3vw; top: 3vh; font-size: 24px; }

/* historia */
.pv-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.pv-skins {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pv-skin,
.pv-cape {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.pv-skin canvas {
  width: 48px;
  height: 96px;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.pv-cape canvas {
  width: 40px;
  height: 64px;
  image-rendering: pixelated;
  border-radius: 3px;
}

.pv-skin figcaption,
.pv-cape figcaption {
  font-size: 0.7rem;
  color: var(--pv-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 64px;
}

.pv-cape figcaption b {
  color: var(--pv-accent);
  font-size: 0.65rem;
}

.pv-cape.is-active canvas {
  outline: 2px solid var(--pv-accent);
  outline-offset: 3px;
}

.pv-capes {
  gap: 14px;
}

.pv-names {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pv-names li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
}

.pv-names li span {
  color: var(--pv-muted);
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .pv-head {
    flex-direction: column;
    align-items: flex-start;
    margin-top: -90px;
  }
  .pv-avatar {
    flex-basis: auto;
    width: 150px;
    height: 210px;
  }
}


/* ---- odznaki ---- */
.pv-badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.pv-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  opacity: 0.55;
  filter: grayscale(0.85);
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.pv-badge:hover { transform: translateY(-2px); opacity: 0.85; }
.pv-badge.is-earned {
  opacity: 1;
  filter: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 22%, transparent), rgba(255, 255, 255, 0.02));
  border-color: color-mix(in srgb, var(--tone) 45%, transparent);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--tone) 18%, transparent);
}
.pv-badge-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tone) 22%, rgba(0, 0, 0, 0.35));
  border: 2px solid color-mix(in srgb, var(--tone) 60%, transparent);
}
.pv-badge.is-earned .pv-badge-icon { box-shadow: 0 0 14px color-mix(in srgb, var(--tone) 55%, transparent); }
.pv-badge-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.pv-badge-text b { font-size: 0.86rem; }
.pv-badge-text small { font-size: 0.72rem; opacity: 0.72; }
.pv-badge-bar {
  display: block;
  height: 4px;
  margin-top: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.pv-badge-bar i { display: block; height: 100%; background: var(--tone); border-radius: 4px; }
.pv-badge-prog { font-size: 0.68rem; opacity: 0.7; }
.pv-badge-reward { font-size: 0.68rem; color: var(--tone); font-weight: 600; }
.pv-stat-flame.is-hot b { color: #ff8a3d; text-shadow: 0 0 12px rgba(255, 120, 40, 0.45); }
.pv-banner-opt.is-locked {
  cursor: not-allowed;
  filter: grayscale(0.7) brightness(0.6);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
}

.pv-stat-coins b { display: inline-flex; align-items: center; gap: 6px; color: #ffd34d; }
.pv-coin { width: 18px; height: 18px; image-rendering: pixelated; }
