/*
 * elevator.css
 * ------------
 * Scène "ascenseur du Grand Magasin" qui apparaît entre
 * les filtres et la grille quand on choisit un rayon.
 *
 * Comprend : décor de galerie, afficheur digital, cabine,
 * portes dorées, panneau de boutons, message d'état.
 */

.elevator-scene {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: .4rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 50% 10%,
      rgba(255, 255, 255, .98),
      transparent 34%
    ),
    repeating-linear-gradient(
      90deg,
      rgba(231, 19, 26, .11) 0 45px,
      rgba(255, 255, 255, .35) 45px 90px
    ),
    linear-gradient(
      180deg,
      #fff4b7,
      #d9b65d
    );
  transition:
    opacity .5s ease,
    visibility .5s ease;
}

.elevator-scene.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.elevator-scene::before {
  content: 'GRAND MAGASIN DU PÈRE NOËL';
  position: absolute;
  top: 20px;
  left: 50%;
  z-index: 4;
  width: max-content;
  max-width: 88vw;
  padding: 9px 22px;
  color: #fff;
  border: 5px solid #fff;
  border-radius: 5px;
  background:
    repeating-linear-gradient(
      -45deg,
      var(--shop-red) 0 12px,
      var(--shop-red-dark) 12px 24px
    );
  box-shadow:
    0 0 0 5px var(--shop-gold),
    8px 9px 0 var(--shop-green-dark);
  font-size: clamp(.65rem, 2vw, .85rem);
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  transform: translateX(-50%) rotate(-1deg);
}

/* ─── Décor de galerie ─────────────────────────────── */

.mall-background {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.mall-background::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .2;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 13%,
      rgba(76, 24, 9, .3) 13.2% 13.7%
    ),
    repeating-linear-gradient(
      180deg,
      transparent 0 23%,
      rgba(76, 24, 9, .2) 23.2% 23.7%
    );
}

.mall-background::after {
  content: '';
  position: absolute;
  right: -15%;
  bottom: -16vh;
  left: -15%;
  height: 37vh;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, .32) 0 1px,
      transparent 1px 85px
    ),
    linear-gradient(180deg, #fff7cf, #b58b31);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .15);
  transform: perspective(550px) rotateX(58deg);
  transform-origin: bottom;
}

.mall-light {
  position: absolute;
  top: -20%;
  bottom: -20%;
  width: 22vw;
  opacity: .4;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, .65),
    transparent
  );
  transform: skewX(-15deg);
  animation: mallLightMove 7s linear infinite;
}

.mall-light:nth-child(1) {
  left: -30%;
}

.mall-light:nth-child(2) {
  left: 30%;
  animation-delay: 2.5s;
}

.mall-light:nth-child(3) {
  left: 75%;
  animation-delay: 5s;
}

@keyframes mallLightMove {
  from {
    transform: translateX(-30vw) skewX(-15deg);
  }

  to {
    transform: translateX(120vw) skewX(-15deg);
  }
}

/* ─── Structure principale ─────────────────────────── */

.elevator-stage {
  position: relative;
  z-index: 3;
  width: min(99vw, 740px);
  padding-top: 42px;
  text-align: center;
}

.elevator-scene.active .elevator-stage {
  animation: elevatorStageEnter .7s cubic-bezier(.16, 1, .3, 1);
}

@keyframes elevatorStageEnter {
  from {
    opacity: 0;
    transform: translateY(45px) scale(.94);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mall-name {
  display: inline-block;
  margin-bottom: .6rem;
  padding: 8px 17px;
  color: #fff;
  border: 4px solid #fff;
  border-radius: 4px;
  background: var(--shop-green);
  box-shadow:
    0 0 0 4px var(--shop-gold),
    5px 6px 0 var(--shop-red-dark);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: 4px;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 var(--shop-red-dark);
  transform: rotate(1deg);
}

/* ─── Afficheur digital ────────────────────────────── */

.elevator-display {
  position: relative;
  width: min(95vw, 585px);
  min-height: 88px;
  margin: 0 auto 10px;
  padding: 14px 20px;
  overflow: hidden;
  border: 7px solid var(--shop-gold);
  border-radius: 10px;
  outline: 5px solid var(--shop-red);
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, .025) 0 3px,
      transparent 3px 6px
    ),
    #050805;
  box-shadow:
    0 0 0 4px #fff,
    8px 10px 0 var(--shop-green-dark),
    inset 0 0 28px #000;
}

.elevator-display::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: .18;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 3px,
    rgba(255, 255, 255, .12) 4px
  );
}

.elevator-display-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 40px 65px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 47px;
  color: #ffd21c;
  font-family: 'Courier New', monospace;
  text-shadow:
    0 0 6px #ffd21c,
    0 0 18px #ff6a00;
}

.elevator-arrow {
  font-size: 1.55rem;
  animation: elevatorArrowMove .7s ease-in-out infinite;
}

@keyframes elevatorArrowMove {
  0%,
  100% {
    opacity: .55;
    transform: translateY(3px);
  }

  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.elevator-floor {
  padding-right: 10px;
  border-right: 1px solid rgba(255, 176, 0, .4);
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.elevator-department {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(.86rem, 2.5vw, 1.08rem);
  font-weight: 800;
  letter-spacing: 1px;
  text-align: left;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.elevator-display.swap .elevator-floor,
.elevator-display.swap .elevator-department {
  animation: departmentRoll .25s ease;
}

@keyframes departmentRoll {
  from {
    opacity: 0;
    filter: blur(4px);
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

.elevator-display.stopped .elevator-display-content {
  color: #47ff8a;
  text-shadow:
    0 0 6px rgba(71, 255, 138, .9),
    0 0 18px rgba(71, 255, 138, .6);
}

.elevator-display.stopped {
  animation: displayDing .55s ease 2;
}

@keyframes displayDing {
  0%,
  100% {
    box-shadow:
      0 0 0 4px #fff,
      8px 10px 0 var(--shop-green-dark),
      inset 0 0 28px #000;
  }

  50% {
    box-shadow:
      0 0 35px rgba(71, 255, 138, .75),
      0 0 0 4px #fff,
      8px 10px 0 var(--shop-green-dark),
      inset 0 0 28px #000;
  }
}

/* ─── Cabine + portes ──────────────────────────────── */

.elevator-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 19px;
}

.elevator-unit {
  position: relative;
  width: min(81vw, 500px);
  height: clamp(400px, 62vh, 540px);
  min-height: 0;
  overflow: hidden;
  border: 13px solid var(--shop-red-dark);
  border-bottom-width: 17px;
  border-radius: 8px 8px 3px 3px;
  outline: 7px solid var(--shop-gold);
  background: #14191d;
  box-shadow:
    0 0 0 12px #fff,
    0 0 0 18px var(--shop-green),
    17px 22px 0 rgba(76, 24, 9, .35),
    0 30px 60px rgba(0, 0, 0, .35);
}

.elevator-unit::before {
  content: 'ASCENSEUR';
  position: absolute;
  top: 11px;
  left: 50%;
  z-index: 8;
  padding: 5px 11px;
  color: #fff;
  border: 2px solid var(--shop-gold);
  border-radius: 4px;
  background: var(--shop-red-dark);
  font-size: .56rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.elevator-cabin {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem 2rem;
  background:
    radial-gradient(
      circle at center,
      rgba(255, 215, 70, .24),
      transparent 56%
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, .05) 0 2px,
      transparent 2px 34px
    ),
    linear-gradient(
      180deg,
      #27583c,
      #0b2015
    );
}

.elevator-unit.moving .elevator-cabin {
  animation: cabinVibration .18s linear infinite;
}

@keyframes cabinVibration {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(2px);
  }
}

.elevator-cabin::before {
  content: '';
  position: absolute;
  top: 18px;
  right: 18%;
  left: 18%;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 18px #fff,
    0 0 45px rgba(255, 255, 255, .45);
}

.elevator-arrival {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  opacity: .35;
  transform: scale(.88);
  transition:
    opacity .7s ease,
    transform .7s cubic-bezier(.16, 1, .3, 1);
}

.elevator-unit.doors-open .elevator-arrival {
  opacity: 1;
  transform: scale(1);
}

.elevator-arrival-icon {
  margin-bottom: 1rem;
  font-size: clamp(5rem, 13vw, 7rem);
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .4));
  animation: arrivalIconFloat 1.4s ease-in-out infinite;
}

@keyframes arrivalIconFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-9px);
  }
}

.elevator-arrival-small {
  margin-bottom: .55rem;
  color: #d7e3da;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.elevator-arrival-name {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.5rem, 4.5vw, 2.35rem);
  line-height: 1.15;
  text-align: center;
  background: linear-gradient(
    135deg,
    #fff,
    #fff476,
    #ffbf00,
    #fff
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: arrivalTextShine 2s linear infinite;
}

@keyframes arrivalTextShine {
  to {
    background-position: 300% 0;
  }
}

.elevator-door {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 5;
  width: 50.2%;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, .1) 0 2px,
      transparent 2px 32px
    ),
    linear-gradient(
      90deg,
      #8b0007 0%,
      #ed1c24 20%,
      #9d080e 48%,
      #ff3940 75%,
      #780006 100%
    );
  box-shadow: inset 0 0 22px rgba(0, 0, 0, .28);
  transition: transform 1.15s cubic-bezier(.65, 0, .35, 1);
}

.elevator-door::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 0 7px rgba(255, 255, 255, .25);
}

.elevator-door::after {
  content: '';
  position: absolute;
  inset: 15px;
  border: 5px double var(--shop-gold);
  opacity: .85;
}

.elevator-door-left {
  left: 0;
  border-right: 2px solid #32383d;
}

.elevator-door-left::before {
  right: 12%;
}

.elevator-door-right {
  right: 0;
  border-left: 2px solid #32383d;
}

.elevator-door-right::before {
  left: 12%;
}

.elevator-unit.doors-open .elevator-door-left {
  transform: translateX(-101%);
}

.elevator-unit.doors-open .elevator-door-right {
  transform: translateX(101%);
}

.elevator-door-center-light {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 7;
  width: 2px;
  opacity: .25;
  background: #fff;
  box-shadow: 0 0 8px #fff;
  transform: translateX(-50%);
  transition: opacity .3s ease;
}

.elevator-unit.doors-open .elevator-door-center-light {
  opacity: 0;
}

/* ─── Panneau de boutons ───────────────────────────── */

.elevator-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  width: 66px;
  max-height: 540px;
  padding: 15px 10px;
  overflow: hidden;
  border: 4px solid var(--shop-red-dark);
  border-radius: 8px;
  outline: 4px solid var(--shop-gold);
  background:
    repeating-linear-gradient(
      90deg,
      #007d34 0 14px,
      #00a847 14px 28px
    );
  box-shadow:
    0 0 0 5px #fff,
    8px 10px 0 rgba(76, 24, 9, .35);
}

.elevator-controls-title {
  margin-bottom: 3px;
  color: #fff;
  font-size: .45rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 var(--shop-red-dark);
}

.elevator-control-dot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  color: #30363b;
  border: 2px solid var(--shop-red-dark);
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    #fff,
    #ffe795 35%,
    #b78600
  );
  box-shadow: 0 2px 4px rgba(0, 0, 0, .35);
  font-size: .62rem;
  font-weight: 800;
}

.elevator-control-dot.active {
  color: #fff;
  background: radial-gradient(
    circle,
    #fff,
    #ffea61 28%,
    #ff6a00 65%,
    #8d1c00
  );
  box-shadow:
    0 0 10px #fff,
    0 0 22px var(--shop-gold),
    0 0 35px var(--shop-red);
  animation: controlPulse .65s ease-in-out infinite alternate;
}

@keyframes controlPulse {
  from {
    transform: scale(.94);
  }

  to {
    transform: scale(1.08);
  }
}

.elevator-status {
  display: inline-block;
  min-height: 24px;
  margin-top: 12px;
  padding: 8px 15px;
  color: #fff;
  border: 4px solid #fff;
  border-radius: 5px;
  background: var(--shop-red);
  box-shadow:
    0 0 0 4px var(--shop-gold),
    5px 6px 0 var(--shop-green-dark);
  font-size: .84rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-align: center;
}
