/**
 * /assets/css/player-profile.css
 *
 * Purpose:  Spielerprofil-Seite Styles
 *           Avatar (Bild + Initialen), Charakter-Grid, Gruppen-Karten,
 *           Freunde-Chips, Nachricht-Modal
 * Deps:     app.css (CSS variables)
 * Load:     index.php
 * Version:  2.0.0 – Avatar-Bild + Initialen-Fallback + Freunde-Chips
 */

/* =========================
   Player Avatar (base)
   ========================= */
.player-profile__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(93, 214, 201, .10);
  border: 2px solid rgba(93, 214, 201, .30);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.player-profile__avatar i {
  font-size: 22px;
  color: var(--accent, #5dd6c9);
}

/* Avatar image variant */
.player-profile__avatar--img {
  object-fit: cover;
  display: block;
}

/* Avatar initials variant */
.player-profile__avatar--initials {
  background: linear-gradient(135deg, rgba(93,214,201,.15), rgba(176,140,255,.15));
}

.player-profile__avatar--initials span {
  font-size: 20px;
  font-weight: 800;
  color: rgba(255,255,255,.75);
}

/* =========================
   Friend Chips
   ========================= */
.friend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}

.friend-chip:hover {
  border-color: rgba(176,140,255,.35);
  background: rgba(176,140,255,.06);
  color: var(--text);
}

.friend-chip__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.friend-chip__initial {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(93,214,201,.2), rgba(176,140,255,.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: rgba(255,255,255,.7);
}

.friend-chip__name {
  font-size: 12px;
  font-weight: 600;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================
   Character Grid (on Player Profile)
   ========================= */
.player-char-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media(min-width: 580px) {
  .player-char-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media(min-width: 860px) {
  .player-char-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* =========================
   Character Card (Player Profile)
   ========================= */
.player-char-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: calc(var(--r) + 2px);
  overflow: hidden;
  background: rgba(255, 255, 255, .02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .20);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.player-char-card:hover,
.player-char-card:focus {
  color: var(--text);
  text-decoration: none;
  transform: translateY(-2px);
  border-color: rgba(93, 214, 201, .30);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .30);
}

.player-char-card:active {
  transform: translateY(1px);
}

.player-char-card--faded {
  opacity: .7;
}

.player-char-card--faded:hover {
  opacity: .9;
}

/* Media */
.player-char-card__media {
  position: relative;
}

.player-char-card__img {
  width: 100%;
  aspect-ratio: 2 / 3;
  height: auto;
  display: block;
  object-fit: cover;
}

.player-char-card--faded .player-char-card__img {
  filter: grayscale(.5) brightness(.7);
}

/* Status Overlay */
.player-char-card__status {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.player-char-card__status i {
  color: rgba(255, 255, 255, .8);
  font-size: 1.5rem;
}

/* Info */
.player-char-card__info {
  padding: 8px 10px 10px;
}

.player-char-card__name {
  font-weight: 800;
  font-size: .9rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-char-card__meta {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, .5);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================
   Mobile
   ========================= */
@media(max-width: 420px) {
  .player-profile__avatar {
    width: 44px;
    height: 44px;
  }

  .player-profile__avatar i {
    font-size: 18px;
  }

  .player-profile__avatar--initials span {
    font-size: 16px;
  }

  .player-char-card__info {
    padding: 6px 8px 8px;
  }

  .player-char-card__name {
    font-size: .8rem;
  }
}

/* =========================
   Reduced Motion
   ========================= */
@media(prefers-reduced-motion: reduce) {
  .player-char-card,
  .friend-chip {
    transition: none;
  }
}
