/* MineDemon Spielerseiten (Stats, Ranking, Clans) im Minecraft-GUI-Stil (2026-10).
   Baut auf den Tokens aus v2.css auf (Pixel-Ecken, Bevel, Blackstone). Tags (Rang/Clan/Discord) stylt tags.css. */

.pp-root { display: block; }
.pp-shell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }

/* ---------- GUI-Panel wie ein Ingame-Inventar ---------- */
.pp-gui {
  position: relative;
  padding: 14px 16px 16px;
  min-width: 0;
  background: var(--px-panel);
  clip-path: var(--px-clip-lg);
  box-shadow: var(--px-bevel), inset 0 0 0 2px rgba(196, 166, 255, 0.14);
}
.pp-gui-title {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding-bottom: 10px;
  font-weight: 900; font-size: 1.05rem; letter-spacing: 0.06em; color: #efe6ff; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 3px 0 rgba(196, 166, 255, 0.12);
}
.pp-gui-title img { width: 20px; height: 20px; image-rendering: pixelated; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.6)); }
.pp-gui-name { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.95rem; }
.pp-gui-sub { margin-left: auto; font-size: 0.9rem; font-weight: 800; letter-spacing: 0.02em; color: #c9bde0; }

/* ---------- Werkzeugleiste, Knöpfe, Suche ---------- */
.pp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pp-gui .pp-toolbar { margin-top: 12px; }
.pp-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px;
  font: inherit; font-weight: 800; color: #f1edf8; cursor: pointer;
  background: linear-gradient(180deg, #3a2a55, #241838);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.16), inset -2px -2px 0 rgba(0, 0, 0, 0.55), 0 0 0 2px #050308;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
  transition: background 0.12s ease, transform 0.12s ease;
}
.pp-btn img { width: 18px; height: 18px; image-rendering: pixelated; }
.pp-btn:hover { background: linear-gradient(180deg, #5a3f86, #36235a); }
.pp-btn:active { transform: translateY(1px); }
.pp-btn.is-active { background: linear-gradient(180deg, #8b5cf6, #5b2fb0); }
.pp-btn[disabled] { opacity: 0.45; cursor: default; transform: none; }
.pp-btn-head { width: 18px; height: 18px; image-rendering: pixelated; }
.pp-flip { transform: scaleX(-1); }

.pp-search {
  display: flex; align-items: center; gap: 8px; flex: 1 1 240px; min-height: 40px; padding: 0 12px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: inset 2px 2px 0 #050308, inset -2px -2px 0 rgba(255, 255, 255, 0.1);
}
.pp-search img { width: 20px; height: 20px; image-rendering: pixelated; }
.pp-search input { flex: 1; min-width: 0; height: 38px; border: 0; background: transparent; color: #fff; font: inherit; font-weight: 700; outline: none; }
.pp-search input::placeholder { color: #8f84a8; }
.pp-search:focus-within { box-shadow: inset 2px 2px 0 #050308, inset -2px -2px 0 rgba(255, 255, 255, 0.1), 0 0 0 2px #fff; }

/* ---------- Slot wie im Inventar ---------- */
.pp-slot {
  display: grid; place-items: center; flex: none; width: 48px; height: 48px;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: inset 2px 2px 0 #050308, inset -2px -2px 0 rgba(255, 255, 255, 0.13);
}
.pp-slot img { width: 32px; height: 32px; image-rendering: pixelated; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.5)); }

/* ---------- Stat-Kachel (Item + Wert + Platz) ---------- */
.pp-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 10px; }
.pp-stat {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left;
  font: inherit; color: inherit; border: 0; cursor: pointer;
  background: rgba(10, 6, 16, 0.55);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.05), inset 3px 0 0 var(--c, #b388ff);
  transition: background 0.12s ease, transform 0.12s ease;
}
.pp-stat.is-static { cursor: default; }
button.pp-stat:hover, button.pp-stat:focus-visible { background: rgba(255, 255, 255, 0.08); transform: translateY(-1px); }
button.pp-stat:hover .pp-slot { box-shadow: inset 2px 2px 0 #050308, inset -2px -2px 0 rgba(255, 255, 255, 0.13), inset 0 0 0 48px rgba(255, 255, 255, 0.12); }
.pp-stat-text { display: grid; gap: 2px; min-width: 0; }
.pp-stat-label { font-size: 0.82rem; font-weight: 800; color: var(--c, #c9bde0); text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.7); }
.pp-stat-value { font-size: 1.15rem; font-weight: 900; color: #fff; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6); overflow-wrap: anywhere; }
.pp-stat-place { position: absolute; top: 6px; right: 8px; font-size: 0.78rem; font-weight: 900; color: #b3a9c9; text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.7); }
.pp-stat-place.is-top-1 { color: #ffd84d; }
.pp-stat-place.is-top-2 { color: #e2e8f0; }
.pp-stat-place.is-top-3 { color: #e8a26a; }

/* ---------- Stats: Profil ---------- */
.pp-profile-body { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 20px; align-items: center; }
.pp-skin {
  display: grid; place-items: end center; min-height: 240px; padding-top: 10px;
  background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--rank-color, #b388ff) 30%, transparent), transparent 70%), rgba(0, 0, 0, 0.35);
  box-shadow: inset 2px 2px 0 #050308, inset -2px -2px 0 rgba(255, 255, 255, 0.08);
}
.pp-skin-img { max-height: 230px; width: auto; image-rendering: pixelated; filter: drop-shadow(4px 6px 0 rgba(0, 0, 0, 0.45)); }
.pp-profile-info { display: grid; gap: 10px; align-content: center; min-width: 0; }
.pp-name { margin: 0; font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 900; color: #fff; overflow-wrap: anywhere; }
.pp-best { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.pp-best button {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; font: inherit; color: #f1edf8; cursor: pointer; border: 0;
  background: rgba(0, 0, 0, 0.45); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent);
}
.pp-best button:hover { background: rgba(255, 255, 255, 0.08); }
.pp-best img { width: 22px; height: 22px; image-rendering: pixelated; }
.pp-best b { color: var(--c); font-weight: 900; }
.pp-best span { font-weight: 700; font-size: 0.86rem; color: #d8cfe9; }

/* ---------- Ranking: Kategorien wie Hotbar-Slots ---------- */
.pp-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-cat {
  position: relative; display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: inset 2px 2px 0 #050308, inset -2px -2px 0 rgba(255, 255, 255, 0.13);
  transition: transform 0.12s ease;
}
.pp-cat img { width: 32px; height: 32px; image-rendering: pixelated; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.5)); }
.pp-cat span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pp-cat:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.1); }
.pp-cat.is-active { background: rgba(255, 255, 255, 0.14); box-shadow: 0 0 0 3px #fff, inset 0 0 0 2px var(--c), 0 0 18px color-mix(in srgb, var(--c) 60%, transparent); }

/* ---------- Ranking: Podest ---------- */
.pp-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.pp-podium-card {
  --pc: #c0c0c0;
  position: relative; display: grid; justify-items: center; gap: 8px; padding: 14px 10px 16px; text-align: center; cursor: pointer;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 22%, transparent), rgba(10, 6, 16, 0.85)), var(--px-card);
  clip-path: var(--px-clip-lg);
  box-shadow: var(--px-bevel), inset 0 0 0 2px color-mix(in srgb, var(--pc) 70%, transparent);
  transition: transform 0.15s ease;
}
.pp-podium-card:hover, .pp-podium-card:focus-visible { transform: translateY(-3px); }
.pp-podium-card.is-top-1 { --pc: #ffd84d; padding-top: 22px; padding-bottom: 26px; }
.pp-podium-card.is-top-2 { --pc: #e2e8f0; }
.pp-podium-card.is-top-3 { --pc: #e8a26a; }
.pp-podium-skin { display: grid; place-items: end center; height: 160px; }
.pp-podium-img { max-height: 156px; width: auto; image-rendering: pixelated; filter: drop-shadow(3px 5px 0 rgba(0, 0, 0, 0.45)); }
.pp-podium-card .ranking-top-emblem { position: absolute; top: 8px; left: 8px; width: 44px; height: 44px; image-rendering: pixelated; }
.pp-podium-name { font-size: 1.1rem; font-weight: 900; color: #fff; overflow-wrap: anywhere; }
.pp-podium-value { font-size: 1.2rem; font-weight: 900; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6); }

/* ---------- Ranking: Liste ---------- */
.pp-list { display: grid; gap: 4px; padding: 10px; }
.pp-row {
  display: grid; grid-template-columns: 64px 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 12px; cursor: pointer;
  background: rgba(10, 6, 16, 0.5);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.04);
  transition: background 0.12s ease;
}
.pp-row:nth-child(even) { background: rgba(22, 14, 34, 0.55); }
.pp-row:hover, .pp-row:focus-visible { background: rgba(255, 255, 255, 0.08); }
.pp-row.is-me { box-shadow: inset 0 0 0 2px #8b5cf6; }
.pp-row.is-found { box-shadow: inset 0 0 0 2px #ffd84d; background: rgba(255, 216, 77, 0.1); }
.pp-row-place { font-weight: 900; font-size: 1rem; color: #b3a9c9; text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.7); }
.pp-row-head { width: 36px; height: 36px; image-rendering: pixelated; box-shadow: 0 0 0 2px #050308; }
.pp-row-name { display: grid; gap: 4px; min-width: 0; }
.pp-row-name > b { font-weight: 900; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-row-tags { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.pp-row-value { font-weight: 900; font-size: 1.05rem; text-align: right; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6); white-space: nowrap; }

/* ---------- Seiten ---------- */
.pp-pager { display: flex; justify-content: center; align-items: center; gap: 14px; font-weight: 900; color: #e6def4; }

/* ---------- Clans ---------- */
.pp-sorts { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-clan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.pp-clan {
  position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 14px 12px; text-align: left;
  font: inherit; color: inherit; border: 0; cursor: pointer;
  background: var(--px-card);
  clip-path: var(--px-clip-lg);
  box-shadow: var(--px-bevel), inset 0 0 0 2px color-mix(in srgb, var(--clan-color, #b388ff) 45%, transparent);
  transition: transform 0.15s ease;
}
.pp-clan:hover, .pp-clan:focus-visible { transform: translateY(-2px); }
.pp-clan-place { position: absolute; top: 8px; right: 12px; font-size: 0.8rem; font-weight: 900; color: #b3a9c9; }
.pp-clan-emblem { width: 56px; height: 56px; }
.pp-clan-tier { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.5)); }
.pp-clan-info { display: grid; gap: 5px; min-width: 0; }
.pp-clan-name { font-size: 1.1rem; font-weight: 900; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 28px; }
.pp-clan-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 0.85rem; font-weight: 800; color: #c9bde0; }
.pp-clan-tag b { color: var(--clan-color, #c084fc); text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.7); }
.pp-clan-tag img { width: 14px; height: 14px; image-rendering: pixelated; }
.pp-clan-members { align-self: end; display: inline-flex; align-items: center; gap: 4px; font-weight: 900; color: #ffbd56; }
.pp-clan-members img { width: 16px; height: 16px; image-rendering: pixelated; }

.pp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.pp-chip {
  display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; font-size: 0.78rem; font-weight: 900; color: var(--c, #e6def4);
  background: rgba(0, 0, 0, 0.5); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c, #b388ff) 45%, transparent); text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.7);
}

.pp-slot-lg { width: 88px; height: 88px; }
.pp-clan-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; margin-bottom: 14px; }
.pp-clan-hero-info { display: grid; gap: 8px; min-width: 0; }
.pp-clan-desc { margin: 0; color: #d8cfe9; line-height: 1.5; }
.pp-clan-hero-tier { display: grid; justify-items: center; gap: 6px; font-weight: 900; text-align: center; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6); }
.pp-clan-hero-tier-img { width: 72px; height: 72px; object-fit: contain; image-rendering: pixelated; }

/* XP-Leiste wie in Minecraft */
.pp-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; margin-bottom: 14px; }
.pp-bar { display: grid; gap: 6px; }
.pp-bar-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 900; color: #fff; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6); }
.pp-bar-foot { font-size: 0.82rem; font-weight: 700; color: #b3a9c9; }
.pp-bar-track { position: relative; height: 14px; background: #050308; box-shadow: inset 0 0 0 2px #1b1426; overflow: hidden; }
.pp-bar-track span { position: absolute; inset: 2px auto 2px 2px; max-width: calc(100% - 4px); background: linear-gradient(180deg, #b6ff6a, #4fbf1c); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25); }
.pp-bar-track::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(5, 3, 8, 0.9) calc(10% - 2px) 10%); pointer-events: none; }
.pp-bar-elo .pp-bar-track span { background: linear-gradient(180deg, color-mix(in srgb, var(--clan-elo-color, #c084fc) 100%, #fff 25%), var(--clan-elo-color, #8b5cf6)); }

.pp-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 8px; }
.pp-member {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 10px; align-items: center; padding: 8px 10px; cursor: pointer;
  background: rgba(10, 6, 16, 0.55); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.05);
}
.pp-member:hover, .pp-member:focus-visible { background: rgba(255, 255, 255, 0.08); }
.pp-member > .md-tags, .pp-member > .rank-badges { grid-column: 2; }
.pp-member-head { width: 40px; height: 40px; image-rendering: pixelated; box-shadow: 0 0 0 2px #050308; grid-row: span 2; }
.pp-member-info { display: grid; min-width: 0; }
.pp-member-info b { font-weight: 900; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-member-role { font-size: 0.8rem; font-weight: 800; color: #c9bde0; }
.pp-member.role-owner .pp-member-role, .pp-member.role-leader .pp-member-role { color: #ffd84d; }

/* ---------- Leer / Laden ---------- */
.pp-empty { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 96px; padding: 16px; color: #d8cfe9; font-weight: 800; }
.pp-empty img { width: 32px; height: 32px; image-rendering: pixelated; }

/* ---------- Mobil ---------- */
@media (max-width: 720px) {
  .pp-profile-body { grid-template-columns: 1fr; }
  .pp-skin { min-height: 200px; }
  .pp-podium { grid-template-columns: 1fr; }
  .pp-podium-card.is-top-1 { order: -1; }
  .pp-row { grid-template-columns: 48px 32px minmax(0, 1fr); }
  .pp-row-value { grid-column: 2 / -1; text-align: left; }
  .pp-row-head { width: 32px; height: 32px; }
  .pp-clan-hero { grid-template-columns: 1fr; justify-items: start; }
  .pp-cats { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
  .pp-cat { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pp-btn, .pp-stat, .pp-cat, .pp-podium-card, .pp-clan, .pp-row { transition: none; }
  .pp-cat:hover, .pp-podium-card:hover, .pp-clan:hover, button.pp-stat:hover { transform: none; }
}

@media (max-width: 480px) {
  /* Schmale Handys: Clan-Tag nur im Profil, in Ranking-Zeilen reicht der Rang. */
  .pp-row .pp-row-tags .md-tag-clan { display: none; }
  .pp-gui { padding: 12px; }
  .pp-stat { padding: 8px 10px; }
}
