/* ==========================================================================
   Skyloria — fiche joueur (joueur.html)
   Chargé par cette page seulement, après base.css, components.css et pages.css.
   ========================================================================== */


/* ---------- Profils ---------- */

.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 10;
  display: grid;
  gap: 2px;
  padding: 6px;
  list-style: none;
  border-radius: var(--r-md);
  background: var(--glass-strong);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-align: left;
  animation: menu-in var(--dur-2) var(--ease-out);
}

.suggestion {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  font-weight: 650;
  cursor: pointer;
}

.suggestion:hover,
.suggestion[aria-selected="true"] {
  background: rgba(255, 212, 71, 0.12);
  color: var(--gold-300);
}

.profile__notice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-md);
  border: 1px dashed rgba(255, 212, 71, 0.35);
  background: rgba(255, 212, 71, 0.05);
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.profile__hero {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 0.5rem + 3vw, 3rem);
  margin-bottom: var(--space-5);
  view-transition-name: profile-hero;
}

.profile__stage {
  position: relative;
  height: 340px;
  display: grid;
  place-items: center;
  border-radius: var(--r-lg);
  background:
    radial-gradient(60% 45% at 50% 88%, rgba(255, 212, 71, 0.22), transparent 70%),
    radial-gradient(80% 60% at 50% 40%, rgba(37, 163, 245, 0.18), transparent 75%),
    rgba(6, 18, 41, 0.45);
  border: 1px solid var(--line);
  overflow: hidden;
}

.profile__stage::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 22px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.45), transparent);
  pointer-events: none;
}

.profile__canvas {
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 600ms var(--ease-out);
  cursor: grab;
}

.profile__canvas.is-ready {
  opacity: 1;
}

.profile__canvas:active {
  cursor: grabbing;
}

.profile__fallback {
  height: 86%;
  width: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.45));
}

.profile__id {
  display: grid;
  gap: var(--space-3);
  align-content: center;
  min-width: 0;
}

.profile__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.profile__badges .badge svg {
  width: 14px;
  height: 14px;
}

.grade-badge {
  display: inline-flex;
  padding: 0.3rem 0.75rem;
  border-radius: var(--r-pill);
  background: rgba(6, 18, 41, 0.6);
  border: 1px solid var(--line-strong);
  font-family: var(--font-pixel);
  font-weight: 700;
}

.grade-badge span {
  background: var(--grade-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.profile__name {
  font-family: var(--font-pixel);
  font-size: clamp(2rem, 1.5rem + 2.4vw, 3.2rem);
  font-weight: 700;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.profile__meta {
  color: var(--text-2);
}

.rank-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.rank-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--r-pill);
  background: rgba(143, 211, 255, 0.08);
  border: 1px solid var(--line);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
  transition: border-color var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}

.rank-chip strong {
  font-variant-numeric: tabular-nums;
  color: var(--text-1);
}

.rank-chip:hover {
  border-color: rgba(255, 212, 71, 0.45);
  transform: translateY(-2px);
}

.rank-chip--top {
  background: rgba(255, 212, 71, 0.12);
  border-color: rgba(255, 212, 71, 0.35);
}

.rank-chip--top strong {
  color: var(--gold-300);
}

.profile__stats {
  margin-bottom: var(--space-5);
}

.profile__stats .stat__label .picon {
  width: 20px;
  height: 20px;
}

.profile__grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  align-items: start;
}

.jobs {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-4);
  list-style: none;
  padding: 0;
}

.job {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
}

.job__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  background: rgba(37, 163, 245, 0.1);
  border: 1px solid rgba(143, 211, 255, 0.18);
}

.job__icon .picon {
  width: 26px;
  height: 26px;
}

.job__body {
  display: grid;
  gap: 0.4rem;
}

.job__head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: 0.95rem;
}

.job__head span {
  color: var(--text-2);
}

.job__xp {
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.job .meter,
.detail .meter {
  height: 8px;
}

.details {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-4);
}

.detail {
  display: grid;
  gap: 0.45rem;
}

.detail__head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--text-2);
}

.detail__head strong {
  color: var(--text-1);
}

.detail__note {
  font-size: var(--fs-sm);
  color: var(--text-3);
}

::view-transition-old(profile-hero),
::view-transition-new(profile-hero) {
  animation-duration: 320ms;
  animation-timing-function: var(--ease-out);
}

/* ---------- Petits écrans ---------- */

@media (max-width: 979px) {
  .profile__hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile__badges,
  .rank-chips {
    justify-content: center;
  }

  .profile__stage {
    height: 300px;
  }
}

/* Lien sous une tuile de chiffre (fiche joueur → fiche d'île) */
.stat__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--sky-300);
}

.stat__link svg {
  width: 14px;
  height: 14px;
}

.stat__link:hover {
  color: var(--gold-300);
}
