/* === Palette officielle Coeur du Multivers === */

/* Couleurs principales */
:root {
  --couleur-douceur-mystique: #DFD5EB; /* Douceur mystique - matière lumineuse */
  --couleur-coeur-mystique: #6E3071; /* Titres - résonance et profondeur */
  --couleur-accent-dore: #E1B14D; /* Accent doré - artefacts, révélations */
  --couleur-fond-principal: #F3F3F2; /* Fond principal - support lumineux */
  --couleur-fond-secondaire: #898693; /* Fond secondaire - zones discrètes */
  --couleur-texte-principal: #2F3031; /* Texte principal - lisible et sobre */
  --rayon-carte: 14px;
  --ombre-legere: 0 8px 24px rgba(47, 48, 49, 0.08);
  --ombre-hover: 0 14px 34px rgba(47, 48, 49, 0.14);
  --transition-fluide: 220ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* === Styles généraux === */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 18px;
  margin: 0;
  padding: 1rem 2rem;
  min-height: 100vh;
  background-color: var(--couleur-fond-principal);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(223, 213, 235, 0.58), transparent 35%),
    radial-gradient(circle at 85% 0%, rgba(225, 177, 77, 0.24), transparent 28%);
  color: var(--couleur-texte-principal);
  line-height: 1.6;
}

p {
  font-size: 24px;
}

main {
  width: 100%;
}

.container {
  max-width: 1700px;
  margin: 0 auto;
  padding: 1rem;
}

h1, h2, h3 {
  color: var(--couleur-coeur-mystique);
  font-weight: 600;
}

h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--couleur-accent-dore);
  padding-bottom: 0.5rem;
  letter-spacing: 0.4px;
}

h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

a {
  color: var(--couleur-accent-dore);
  text-decoration: none;
  transition: color var(--transition-fluide), opacity var(--transition-fluide);
}

a:hover {
  text-decoration: underline;
  opacity: 0.88;
}

/* === Blocs de navigation partagés === */
header,
.page-topbar {
  background: linear-gradient(100deg, #23183d 0%, #3f2b67 78%, #5b4292 100%);
  color: #eee;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

header {
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  z-index: 1000;
}

.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.5rem;
  border-radius: 18px;
}

.brand-block {
  display: inline-flex;
  flex-direction: column;
  gap: 0.18rem;
  padding: 0.55rem 0.9rem 0.6rem;
  border: 1px solid rgba(231, 214, 255, 0.24);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.brand-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ead8ff;
}

header h1 {
  margin: 0;
  padding: 0;
  border-bottom: none;
  text-align: left;
  color: #f8f2ff;
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 10px rgba(12, 7, 24, 0.35);
}

.header-right,
.menu-area {
  display: flex;
  align-items: center;
  position: relative;
}

.hamburger-btn {
  display: inline-block;
  border: 1px solid rgba(137, 134, 147, 0.45);
  background: #fff;
  color: var(--couleur-coeur-mystique);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  border-radius: 999px;
  padding: 0.54rem 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: var(--ombre-legere);
  transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.hamburger-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--ombre-hover);
}

.hamburger-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid rgba(137, 134, 147, 0.45);
  border-radius: 12px;
  box-shadow: var(--ombre-hover);
  overflow: hidden;
  z-index: 30;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.hamburger-menu.open {
  display: block;
}

.hamburger-menu a {
  display: block;
  margin: 0;
  padding: 0.7rem 0.9rem;
  color: var(--couleur-texte-principal);
  text-decoration: none;
  border-bottom: 1px solid rgba(137, 134, 147, 0.2);
}

.hamburger-menu a:last-child {
  border-bottom: none;
}

.hamburger-menu a:hover,
.hamburger-menu a[aria-current="page"] {
  background: rgba(223, 213, 235, 0.48);
  color: var(--couleur-coeur-mystique);
  opacity: 1;
}

.page-topbar .back-btn {
  margin-bottom: 0;
}

/* === Pied de page partagé === */
footer {
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
  margin-top: 2.5rem;
  background: linear-gradient(120deg, #1a1130 0%, #2e1f52 60%, #4a2f7a 100%);
  color: #d8cde8;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-bottom: 1rem;
}

.footer-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #e1b14d;
  text-transform: uppercase;
}

.footer-year {
  font-size: 0.8rem;
  color: #a08cc0;
  letter-spacing: 0.04em;
}

.footer-divider {
  width: 60px;
  height: 2px;
  margin: 0 auto 1rem;
  background: linear-gradient(90deg, transparent, #e1b14d, transparent);
  border-radius: 2px;
}

.footer-legal {
  margin: 0.15rem auto;
  max-width: 680px;
  color: #8e80aa;
  font-size: 0.78rem;
}

/* === Blocs éditoriaux partagés === */
.hero-panel {
  margin-bottom: 1.5rem;
  border-radius: 24px;
  padding: 1.3rem 1.25rem 1.5rem;
}

.hero-panel h2,
.home-card h2 {
  margin-top: 0;
  font-size: 40px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.page-banner {
  margin: 0.5rem 0 1.25rem;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--ombre-legere);
  border: 1px solid rgba(137, 134, 147, 0.35);
  background: #fff;
}

.page-banner img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  object-position: center;
}

.btn-primary,
.btn-secondary {
  display: inline-block;
  border-radius: 999px;
  padding: 0.56rem 1rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.accueil-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.4rem;
}

.home-card {
  margin: 0;
  border-radius: 18px;
  padding: 3rem 3.5rem 3.5rem;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.home-card:hover {
  transform: translateY(-4px);
}

/* === Boutons === */
.back-btn {
  margin-bottom: 1rem;
  background: linear-gradient(130deg, var(--couleur-accent-dore), #bf8f2f);
  color: var(--couleur-fond-principal);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: transform var(--transition-fluide), box-shadow var(--transition-fluide), filter var(--transition-fluide);
  display: inline-block;
  box-shadow: 0 6px 16px rgba(110, 48, 113, 0.2);
}

.back-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 10px 20px rgba(110, 48, 113, 0.24);
  text-decoration: none;
}

/* === Grilles === */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-top: 1.5rem;
}

/* === Cartes === */
.card, .char-card {
  background: linear-gradient(180deg, #fff 0%, rgba(243, 243, 242, 0.96) 100%);
  border: 1px solid rgba(137, 134, 147, 0.42);
  border-radius: var(--rayon-carte);
  padding: 1.2rem;
  box-shadow: var(--ombre-legere);
  cursor: pointer;
  transition: transform var(--transition-fluide), box-shadow var(--transition-fluide), border-color var(--transition-fluide);
  text-align: center;
  color: var(--couleur-texte-principal);
}

.card:hover, .char-card:hover {
  transform: translateY(-4px);
  border-color: rgba(110, 48, 113, 0.45);
  box-shadow: var(--ombre-hover);
}

.card h3,
.char-card h3 {
  margin: 0.2rem 0 0.55rem;
  font-size: 1.1rem;
}

.card p,
.char-card p {
  margin: 0;
  color: rgba(47, 48, 49, 0.86);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  background-color: var(--couleur-accent-dore);
  color: var(--couleur-fond-principal);
  text-transform: uppercase;
}

/* === Logos univers et personnages === */
.univ-logo, .perso-logo {
  max-width: 90%;
  max-height: 100px;
  object-fit: contain;
  margin: 0 auto 12px auto;
  display: block;
  border-radius: 12px;
  filter: drop-shadow(0 4px 8px rgba(47, 48, 49, 0.14));
}

/* === Vue détaillée d’un personnage === */
.details-view {
  background: var(--couleur-fond-principal);
  border-radius: 12px;
  padding: 1.8rem;
  margin-top: 2rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  border: 1px solid var(--couleur-fond-secondaire);
  color: var(--couleur-texte-principal);
}

.details-view .back-btn {
  float: right;
  margin-top: -10px;
  margin-right: -10px;
}

.alias-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}

.alias-tag {
  background: var(--couleur-douceur-mystique);
  border: 1px solid var(--couleur-fond-secondaire);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-family: monospace;
  color: var(--couleur-coeur-mystique);
}

:focus-visible {
  outline: 2px solid var(--couleur-accent-dore);
  outline-offset: 2px;
}

/* === Animation d'apparition légère === */
@keyframes apparition-douce {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1,
.back-btn,
.char-header,
.content-box,
.sidebar-box,
.details-view,
.card,
.char-card {
  animation: apparition-douce 520ms ease both;
}

.grid > .card,
.grid > .char-card {
  animation-duration: 620ms;
}

.grid > :nth-child(2) {
  animation-delay: 60ms;
}

.grid > :nth-child(3) {
  animation-delay: 110ms;
}

.grid > :nth-child(4) {
  animation-delay: 160ms;
}

.grid > :nth-child(n + 5) {
  animation-delay: 200ms;
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-panel,
.home-card {
  animation: reveal-up 0.7s ease both;
}

.home-card:nth-child(2) { animation-delay: 0.05s; }
.home-card:nth-child(3) { animation-delay: 0.1s; }
.home-card:nth-child(4) { animation-delay: 0.15s; }
.home-card:nth-child(5) { animation-delay: 0.2s; }
.home-card:nth-child(6) { animation-delay: 0.25s; }
.home-card:nth-child(7) { animation-delay: 0.3s; }
.home-card:nth-child(8) { animation-delay: 0.35s; }
.home-card:nth-child(9) { animation-delay: 0.4s; }
.home-card:nth-child(10) { animation-delay: 0.45s; }

@media (prefers-reduced-motion: reduce) {
  h1,
  .back-btn,
  .char-header,
  .content-box,
  .sidebar-box,
  .details-view,
  .card,
  .char-card {
    animation: none;
  }

  .hero-panel,
  .home-card {
    animation: none;
  }
}

/* === Responsive === */
@media (max-width: 600px) {
  body {
    padding: 1rem;
  }

  .container {
    padding: 0.25rem;
  }

  header,
  .page-topbar {
    align-items: flex-start;
  }

  header {
    padding: 0.9rem 1rem;
  }

  .header-right,
  .menu-area {
    align-items: flex-start;
  }

  .brand-block {
    padding: 0.48rem 0.75rem 0.52rem;
  }

  .brand-kicker {
    font-size: 0.68rem;
  }

  header h1 {
    font-size: 1.02rem;
  }

  .hamburger-menu {
    min-width: 190px;
  }

  .hero-panel {
    border-radius: 18px;
    padding: 1rem;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    text-align: center;
  }

  .home-card {
    border-radius: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .char-card {
    padding: 1rem;
  }
}