/* Refonte « Portails » : le hall d'accueil et ses portails.
   Animations sur transform, opacity et filter seulement ; vivant.css les coupe pour qui demande moins d'animations. */

.dz-hall {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 72px 16px 64px;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 45% at 50% 18%, rgb(79 143 209 / 28%), transparent 70%),
    radial-gradient(ellipse 90% 60% at 50% 110%, rgb(44 95 141 / 40%), transparent 70%),
    linear-gradient(180deg, #050a12 0%, var(--dz-night) 55%, #050a12 100%);
  border-bottom: 1px solid var(--dz-line);
}

/* L'image d'accueil du panel : une couche fondue derrière les lueurs. */
.dz-hall-image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  /* --hall-veil : l'assombrissement réglé dans le panel (Apparence), 0,8 à l'origine. */
  background: linear-gradient(180deg, rgb(5 10 18 / calc(var(--hall-veil, 0.8) * 0.9)), rgb(5 10 18 / calc(var(--hall-veil, 0.8) * 1.1)) 60%, var(--dz-night)), var(--hero) center / cover no-repeat;
}

/* Lueurs qui respirent derrière l'emblème. */
.dz-hall-glow {
  position: absolute;
  left: 50%;
  top: 40px;
  z-index: -1;
  width: min(720px, 120vw);
  height: 480px;
  margin-left: calc(min(720px, 120vw) / -2);
  background: radial-gradient(circle, rgb(169 205 245 / 26%), rgb(79 143 209 / 10%) 40%, transparent 70%);
  filter: blur(8px);
  animation: dz-breathe 7s ease-in-out infinite;
}

.dz-hall-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(900px, 100%);
  margin: 0 auto;
}

.dz-hall-emblem {
  width: clamp(104px, 22vw, 160px);
  height: auto;
  filter: drop-shadow(0 0 28px rgb(79 143 209 / 55%));
  animation: dz-enter 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0s backwards, dz-float 6s ease-in-out 0.7s infinite;
}

/* L'entrée du hall, en cascade de haut en bas. « backwards » seulement : une fois entré, rien n'est figé,
   et la traversée d'un portail peut encore effacer le hall. */
.dz-hall-inner > .dz-hero-kicker {
  animation: dz-enter 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.08s backwards;
}

.dz-hall-inner > h1 {
  animation: dz-enter 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.16s backwards;
}

.dz-hall-inner > .dz-hero-tagline {
  animation: dz-enter 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.28s backwards;
}

.dz-hall-inner > .dz-hero-actions {
  animation: dz-enter 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.38s backwards;
}

.dz-hall-inner > .dz-live {
  animation: dz-enter 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.46s backwards;
}

.dz-hall > .dz-portals-title {
  animation: dz-enter 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.56s backwards;
}

.dz-portals > li:nth-child(1) {
  animation: dz-enter 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.64s backwards;
}

.dz-portals > li:nth-child(2) {
  animation: dz-enter 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.72s backwards;
}

.dz-portals > li:nth-child(3) {
  animation: dz-enter 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.8s backwards;
}

.dz-portals > li:nth-child(n + 4) {
  animation: dz-enter 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.88s backwards;
}

.dz-hall h1 {
  font-size: clamp(2.6rem, 10vw, 6rem);
  line-height: 0.95;
  letter-spacing: 3px;
  overflow-wrap: anywhere;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .dz-hall h1 {
    background: linear-gradient(180deg, #fff 30%, var(--dz-sky) 75%, #ffd27a 120%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 4px 22px rgb(0 0 0 / 50%));
  }
}

.dz-hall p {
  margin: 0;
}

.dz-portals-title {
  margin: 56px auto 22px;
  font-size: clamp(1.3rem, 3.5vw, 1.8rem);
  letter-spacing: 6px;
}

/* Les portails : des arches où tourbillonne chaque monde. */
.dz-portals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 260px));
  justify-content: center;
  gap: 28px;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.dz-portal {
  --accent: var(--dz-warden-bright);
  --image: none;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-height: 340px;
  /* Le haut de l'arche reste libre : une longue étiquette grandit le portail au lieu d'être rognée par la courbe. */
  padding: 120px 14px 18px;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--accent) 70%, #fff);
  border-radius: 140px 140px 14px 14px;
  background: #04070c;
  box-shadow: 0 0 28px color-mix(in srgb, var(--accent) 45%, transparent), inset 0 0 40px rgb(0 0 0 / 70%);
  color: #fff;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* L'image du jeu, mêlée au tourbillon. */
.dz-portal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--image) center / cover no-repeat;
  opacity: var(--portal-image, 0.55);
  mix-blend-mode: var(--portal-blend, screen);
}

.dz-portal-swirl {
  position: absolute;
  inset: -45%;
  z-index: -1;
  background: conic-gradient(from 0deg, #04070c, var(--accent), #04070c 30%, color-mix(in srgb, var(--accent) 60%, #fff) 50%, #04070c 70%, var(--accent), #04070c);
  /* Opacité et vitesse réglées dans le panel (Apparence) ; --portal-spin à 0 s : il ne tourne plus. */
  opacity: var(--portal-swirl, 0.85);
  animation: dz-swirl var(--portal-spin, 14s) linear infinite;
}

/* Anneaux du vortex qui tournent à contre-sens des rayons, et voile qui assombrit le bas pour le texte. */
.dz-portal::after {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 50%, transparent 10%, rgb(4 7 12 / 50%) 46%, rgb(4 7 12 / 92%) 70%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0 16px, color-mix(in srgb, var(--accent) 30%, transparent) 16px 18px);
  opacity: var(--portal-rings, 1);
  animation: dz-swirl calc(var(--portal-spin, 14s) * 1.5714) linear infinite reverse;
}

.dz-portal:hover,
.dz-portal:focus-visible {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 0 46px color-mix(in srgb, var(--accent) 75%, transparent), inset 0 0 40px rgb(0 0 0 / 60%);
  color: #fff;
}

.dz-portal:hover .dz-portal-swirl,
.dz-portal:focus-visible .dz-portal-swirl {
  /* Au survol, le tourbillon s'emballe ; arrêté dans le panel, il le reste. */
  animation-duration: calc(var(--portal-spin, 14s) * 0.2857);
}

.dz-portal-label {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgb(4 7 12 / 82%);
}

.dz-portal-label b {
  font: 700 1.5rem/1.05 var(--dz-display);
  text-transform: uppercase;
  letter-spacing: 2px;
  overflow-wrap: anywhere;
}

.dz-portal-label small {
  color: #dbe6f3;
  font-size: 0.9rem;
  line-height: 1.35;
}

/* Bouton « Carte » du portail Foxhole : une pastille posée à cheval sur le bas du portail, hors de son lien. */
.dz-portals > li {
  position: relative;
}

.dz-portal-map {
  position: absolute;
  bottom: -16px;
  left: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 14px;
  border: 1px solid var(--dz-warden-bright);
  border-radius: 999px;
  background: rgb(4 7 12 / 92%);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  transform: translateX(-50%);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dz-portal-map:hover,
.dz-portal-map:focus-visible {
  border-color: #fff;
  background: color-mix(in srgb, var(--dz-warden-bright) 45%, rgb(4 7 12));
}

.dz-portal-map-icon {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.dz-portal .dz-card-chips {
  position: absolute;
  top: 70px;
  left: 12px;
  right: 12px;
  justify-content: center;
}

@media (max-width: 560px) {
  .dz-hall {
    padding: 48px 16px 44px;
  }

  .dz-portals {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .dz-portal { min-height: 260px; }
}

/* Hall sorti de l'écran (portails.js) : ses animations s'arrêtent, rien n'est redessiné pour rien. */
.dz-hall.dz-asleep *,
.dz-hall.dz-asleep *::before,
.dz-hall.dz-asleep *::after {
  animation-play-state: paused;
}

@keyframes dz-swirl {
  to { transform: rotate(360deg); }
}

@keyframes dz-breathe {
  50% { transform: scale(1.08); opacity: 0.75; }
}

@keyframes dz-enter {
  from { opacity: 0; transform: translateY(18px); }
}

@keyframes dz-float {
  50% { transform: translateY(-8px); }
}

/* La traversée (portails.js) : le portail s'emballe et s'approche, la page se referme sur lui. */
.dz-portal.dz-traversing {
  z-index: 60;
  transform: scale(1.12);
  transition: transform 0.7s cubic-bezier(0.5, 0, 0.75, 0);
}

.dz-portal.dz-traversing .dz-portal-swirl {
  animation: dz-swirl 0.6s linear infinite, dz-engulf 0.7s ease-in forwards;
}

body.dz-traversing main > :not(.dz-hall),
body.dz-traversing .dz-hall-inner,
body.dz-traversing .dz-portals-title,
body.dz-traversing .dz-portals > li:not(:has(.dz-traversing)) {
  opacity: 0;
  transition: opacity 0.4s ease;
}

body.dz-traversing::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  background: #04070c;
  opacity: 0;
  animation: dz-close 0.7s ease-in forwards;
}

@keyframes dz-engulf {
  to { transform: scale(2.4) rotate(180deg); opacity: 1; filter: blur(2px) brightness(1.6); }
}

@keyframes dz-close {
  60% { opacity: 0.2; }
  to { opacity: 1; }
}
