/* ===== REGISTRE DES AVENTURIERS ===== */

/* Header */
.registre-header {
  position: relative;
  text-align: center;
  padding: 6rem 2rem 2rem;
  overflow: hidden;
  background: #120000;
}

.hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(2px) brightness(0.90) saturate(0.9);
}

.hero-video-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, #120000, transparent);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.registre-intro {
  max-width: 650px;
  margin: 1.5rem auto 0;
  color: #e7d7c1;
  font-size: 1rem;
  line-height: 1.8;
}

/* Search & Filters */
.registre-controls {
  text-align: center;
  padding-top: 2rem;
  padding-bottom: 1rem;
}

.search-bar {
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

.search-bar input {
  width: 100%;
  padding: 0.7rem 1.2rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: #e7d7c1;
  background: #3f0418;
  border: 1px solid #735751;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.3s;
}

.search-bar input::placeholder {
  color: #a78a7f;
  opacity: 0.6;
}

.search-bar input:focus {
  border-color: #a78a7f;
}

.filter-bar {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.filter-btn {
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.4rem 1rem;
  background: transparent;
  color: #a78a7f;
  border: 1px solid #735751;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-btn:hover {
  background: rgba(115, 87, 81, 0.2);
}

.filter-btn.active {
  background: #735751;
  color: #e7d7c1;
  border-color: #a78a7f;
}

.viewer-count {
  font-size: 0.85rem;
  color: #735751;
  margin: 0;
}

/* Grid */
.registre-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.loading-msg {
  grid-column: 1 / -1;
  text-align: center;
  color: #a78a7f;
  font-style: italic;
}

/* Viewer Card */
.viewer-card {
  background: linear-gradient(160deg, #3f0418 0%, #370617 100%);
  border: 1px solid rgba(115, 87, 81, 0.3);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.viewer-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 24px rgba(18, 0, 0, 0.4);
  border-color: #a78a7f;
}

/* Rarity glow on top border */
.viewer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 2px;
  border-radius: 0 0 3px 3px;
  opacity: 0.6;
}

.viewer-card[data-rarity="bronze"]::before {
  background: linear-gradient(90deg, transparent, #8b6914, transparent);
}

.viewer-card[data-rarity="gold"]::before {
  background: linear-gradient(90deg, transparent, #c9a84c, transparent);
}

.viewer-card[data-rarity="red"]::before {
  background: linear-gradient(90deg, transparent, #a4161a, transparent);
}

.viewer-card[data-rarity="violet"]::before {
  background: linear-gradient(90deg, transparent, #7b2d8b, transparent);
}

.viewer-card[data-rarity="silver"]::before {
  background: linear-gradient(90deg, transparent, #a8a8a8, transparent);
}

.viewer-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 0.8rem;
  display: block;
  border: 2px solid #735751;
  object-fit: cover;
}

.viewer-card[data-rarity="gold"] .viewer-avatar { border-color: #c9a84c; }
.viewer-card[data-rarity="red"] .viewer-avatar { border-color: #a4161a; }
.viewer-card[data-rarity="violet"] .viewer-avatar { border-color: #7b2d8b; }
.viewer-card[data-rarity="silver"] .viewer-avatar { border-color: #a8a8a8; }

.viewer-name {
  font-family: 'MedievalSharp', cursive;
  font-size: 1rem;
  color: #e7d7c1;
  margin-bottom: 0.3rem;
}

.viewer-role {
  font-size: 1rem;
  color: #a78a7f;
  font-style: italic;
  margin-bottom: 0.3rem;
}

.viewer-motto {
  font-size: 1rem;
  color: #735751;
  font-style: italic;
  margin: 0;
}

.viewer-badges {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.6rem;
}

.badge {
  font-size: 0.7rem;
  font-family: var(--font-title);
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  border: 1px solid;
}

.badge-sub {
  color: #c9a84c;
  border-color: #c9a84c;
}

.badge-mod {
  color: #a4161a;
  border-color: #a4161a;
}

.badge-vip {
  color: #7b2d8b;
  border-color: #7b2d8b;
}

.badge-clue {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #a855c7;
  border-color: #7a3d8f;
}

.badge-discovery {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #4ec9b0;
  border-color: #2e8b73;
}

.badge-icon {
  width: 14px;
  height: 14px;
  image-rendering: pixelated;
}

.badge-loot-icon {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.badge-count {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 0.6rem;
  font-family: var(--font-title);
  color: #c9a84c;
  background: rgba(22, 4, 1, 0.85);
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid #735751;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 4, 1, 0.85);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: linear-gradient(160deg, #3f0418 0%, #370617 100%);
  border: 2px solid #735751;
  border-radius: 10px;
  max-width: 500px;
  width: 100%;
  padding: 2.5rem;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  background: none;
  border: none;
  color: #735751;
  font-size: 1.8rem;
  cursor: pointer;
  transition: color 0.3s;
  line-height: 1;
}

.modal-close:hover {
  color: #a78a7f;
}

/* Modal content */
.modal-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

.modal-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid #735751;
  object-fit: cover;
  flex-shrink: 0;
}

.modal-card[data-rarity="gold"] .modal-avatar { border-color: #c9a84c; }
.modal-card[data-rarity="red"] .modal-avatar { border-color: #a4161a; }
.modal-card[data-rarity="violet"] .modal-avatar { border-color: #7b2d8b; }
.modal-card[data-rarity="silver"] .modal-avatar { border-color: #a8a8a8; }

.modal-card[data-rarity="gold"] { border-color: #c9a84c; }
.modal-card[data-rarity="red"] { border-color: #a4161a; }
.modal-card[data-rarity="violet"] { border-color: #7b2d8b; }
.modal-card[data-rarity="silver"] { border-color: #a8a8a8; }

.modal-name {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: #e7d7c1;
  margin-bottom: 0.2rem;
}

.modal-motto {
  font-size: 1rem;
  color: #a78a7f;
  font-style: italic;
}

.modal-section {
  margin-bottom: 1.2rem;
}

.modal-label {
  font-family: var(--font-title);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a78a7f;
  margin-bottom: 0.4rem;
  font-weight: 900;
}

.modal-role {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.modal-role-icon {
  width: 76px;
  height: 76px;
  object-fit: contain;
}

.modal-role-name {
  font-family: var(--font-title);
  font-size: 1.05rem;
  color: #e7d7c1;
  font-weight: 900;
}

.modal-stats {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.modal-stat {
  flex: 1;
  text-align: center;
  padding: 0.6rem;
  background: rgba(115, 87, 81, 0.1);
  border-radius: 5px;
  border: 1px solid rgba(115, 87, 81, 0.15);
}

.modal-stat-value {
  font-family: var(--font-title);
  font-size: 1rem;
  color: #e7d7c1;
  display: block;
  order: 2;
}

.modal-stat-label {
  font-size: 0.9rem;
  color: #a78a7f;
  order: 1;
  font-weight: 900;
}

.modal-stat {
  display: flex;
  flex-direction: column;
}

.modal-inventory {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.inventory-pack {
  width: 100%;
}

/* Legacy text items */
.inventory-item {
  font-size: 0.78rem;
  color: #e7d7c1;
  background: rgba(115, 87, 81, 0.15);
  border: 1px solid rgba(115, 87, 81, 0.25);
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
  font-weight: 600;
}

.inventory-empty {
  font-size: 0.78rem;
  color: #735751;
}

/* Pack container */
.inventory-pack {
  background: rgba(115, 87, 81, 0.08);
  border: 1px solid rgba(115, 87, 81, 0.2);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
}

.pack-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.pack-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.pack-name {
  font-family: var(--font-title);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c9a84c;
  font-weight: 700;
}

/* Loot items grid */
.pack-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.loot-item {
  position: relative;
  width: 40px;
  height: 40px;
  background: rgba(115, 87, 81, 0.15);
  border: 1px solid rgba(115, 87, 81, 0.3);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.loot-item:hover,
.loot-item:focus {
  border-color: #c9a84c;
  background: rgba(201, 168, 76, 0.1);
}

.loot-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* Tooltip */
.loot-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a0505;
  color: #e7d7c1;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  border: 1px solid #735751;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}

.loot-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #735751;
}

.loot-item:hover .loot-tooltip,
.loot-item:focus .loot-tooltip {
  opacity: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .registre-list {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .modal-card {
    padding: 1.5rem;
  }

  .modal-header {
    flex-direction: column;
    text-align: center;
  }
}
