/* Profil joueur depuis le classement — modales + animations */

@keyframes lb-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes lb-panel-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes lb-slot-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lb-profile-root,
.lb-artifact-root {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-top: max(1rem, env(safe-area-inset-top));
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  pointer-events: none;
}

.lb-profile-root.lb-open,
.lb-artifact-root.lb-open {
  pointer-events: auto;
}

.lb-profile-root.hidden,
.lb-artifact-root.hidden {
  display: none;
}

.lb-profile-backdrop,
.lb-artifact-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.28s var(--ease, ease);
}

.lb-open .lb-profile-backdrop,
.lb-open .lb-artifact-backdrop {
  opacity: 1;
  animation: lb-backdrop-in 0.28s ease forwards;
}

.lb-profile-panel,
.lb-artifact-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: min(88vh, 720px);
  margin: 0 auto;
  border-radius: 20px;
  border: 1px solid rgba(0, 245, 212, 0.28);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(0, 245, 212, 0.12), transparent 50%),
    linear-gradient(180deg, #121a24 0%, #0a0e14 100%);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(14px) scale(0.97);
  opacity: 0;
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease;
}

.lb-artifact-root {
  z-index: 2100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.lb-artifact-panel {
  width: 100%;
  max-width: 420px;
  max-height: min(85vh, 560px);
  border-radius: 18px;
  margin: 0;
  border-bottom: 1px solid rgba(0, 245, 212, 0.28);
  transform: translateY(10px) scale(0.97);
}

.lb-open .lb-profile-panel,
.lb-open .lb-artifact-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
  animation: lb-panel-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Ancien style bottom-sheet retiré — modale toujours centrée */

.lb-profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.15rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lb-profile-head-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}

.lb-profile-avatar {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 2px solid rgba(0, 245, 212, 0.35);
  background-color: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.12);
  image-rendering: pixelated;
  overflow: hidden;
}

.lb-profile-title-wrap h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  color: #fff;
}

.lb-profile-rank {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--gris, #9ca3af);
}

.lb-profile-close,
.lb-artifact-close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.lb-profile-close:hover,
.lb-artifact-close:hover {
  background: rgba(0, 245, 212, 0.12);
  transform: scale(1.05);
}

.lb-profile-body {
  padding: 1rem 1.15rem 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.lb-profile-meta {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.lb-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.lb-meta-label {
  color: var(--gris, #9ca3af);
}

.lb-meta-value {
  color: #f3f4f6;
  font-weight: 600;
  text-align: right;
}

.lb-profile-crew {
  margin-bottom: 1rem;
}

.lb-profile-crew-card {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 245, 212, 0.28);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(254, 228, 64, 0.1), transparent 55%),
    rgba(0, 0, 0, 0.28);
}

.lb-profile-crew-name {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  color: #fff;
}

.lb-profile-crew-role-label {
  margin: 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--turquoise);
}

.lb-profile-crew-role {
  margin: 0.15rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: #fde047;
}

.lb-profile-crew-none {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  color: var(--gris);
  font-size: 0.88rem;
}

.lb-profile-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #00f5d4;
}

.lb-inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.55rem;
}

.lb-inv-slot {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.45rem;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  opacity: 1;
  transform: translateY(0);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.18s ease;
}

.lb-profile-body.lb-inv-animate .lb-inv-slot {
  animation: lb-slot-pop 0.35s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.lb-inv-slot:hover,
.lb-inv-slot:focus-visible {
  border-color: rgba(0, 245, 212, 0.45);
  box-shadow: 0 0 0 1px rgba(0, 245, 212, 0.2);
  transform: translateY(-2px);
  outline: none;
}

.lb-inv-thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35) center/cover no-repeat;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.35);
}

.lb-inv-thumb.lb-inv-thumb-empty {
  background: linear-gradient(145deg, #1e293b, #0f172a);
}

.lb-inv-name {
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.25;
  color: #e5e7eb;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lb-inv-qty {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: #00f5d4;
}

.lb-rarity-dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  margin-right: 0.25rem;
  vertical-align: middle;
}

.lb-profile-loading,
.lb-profile-error {
  text-align: center;
  padding: 1.5rem 0.5rem;
  color: var(--gris, #9ca3af);
  font-size: 0.9rem;
}

.lb-profile-error {
  color: #f87171;
}

/* Bouton pseudo dans le tableau */
.lb-player-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: #00f5d4;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(0, 245, 212, 0.35);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.lb-player-btn:hover,
.lb-player-btn:focus-visible {
  color: #5fffe8;
  text-decoration-color: rgba(94, 255, 232, 0.8);
  outline: none;
}

/* Détail artefact (2e modale) */
.lb-artifact-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lb-artifact-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  padding-right: 0.5rem;
}

.lb-artifact-body {
  padding: 1rem;
  max-height: 60vh;
  overflow-y: auto;
}

.lb-artifact-visual {
  width: 100%;
  max-height: 200px;
  border-radius: 12px;
  margin-bottom: 0.85rem;
  background: rgba(0, 0, 0, 0.35) center/contain no-repeat;
  min-height: 120px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.lb-artifact-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.lb-artifact-badge-rarity {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0a0e14;
}

.lb-badge-points,
.lb-badge-qty {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.lb-badge-points {
  background: rgba(254, 228, 64, 0.2);
  color: #fde047;
  border: 1px solid rgba(254, 228, 64, 0.35);
}

.lb-badge-qty {
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.lb-artifact-desc {
  font-size: 0.86rem;
  line-height: 1.5;
  color: #d1d5db;
  margin: 0 0 0.85rem;
}

.lb-artifact-effect {
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  margin: 0 0 0.85rem;
  background: rgba(0, 245, 212, 0.06);
  border: 1px solid rgba(0, 245, 212, 0.2);
}

.lb-artifact-effect h4 {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #00f5d4;
}

.lb-artifact-effect-cat {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #7ee8d8;
}

.lb-artifact-effect-text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #e5e7eb;
}

.lb-artifact-how {
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: rgba(0, 245, 212, 0.06);
  border: 1px solid rgba(0, 245, 212, 0.2);
}

.lb-artifact-how h4 {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #00f5d4;
}

.lb-artifact-how p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #e5e7eb;
}

@media (prefers-reduced-motion: reduce) {
  .lb-profile-backdrop,
  .lb-profile-panel,
  .lb-artifact-backdrop,
  .lb-artifact-panel,
  .lb-inv-slot,
  .lb-profile-body.lb-inv-animate .lb-inv-slot {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .lb-open .lb-profile-panel,
  .lb-open .lb-artifact-panel {
    opacity: 1;
    transform: none;
  }
}
