/* ================================================
   Mascot — Page Transition Overlay
   Shows on every inter-page navigation via sessionStorage flag
   ================================================ */

/* ── Overlay backdrop ── */
#mascot-transition {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #fff8e1 0%, #fff3cd 45%, #ffe082 100%);
  /* Hidden by default */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#mascot-transition.is-visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Mascot wrapper — bouncing ── */
.mt-mascot-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mt-bounce 0.7s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite alternate;
}

@keyframes mt-bounce {
  0%   { transform: translateY(0px)   scale(1);    }
  100% { transform: translateY(-24px) scale(1.05); }
}

/* ── Mascot image ── */
.mt-mascot-img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 14px 28px rgba(255, 190, 0, 0.5));
  animation: mt-wiggle 1.4s ease-in-out infinite;
}

@keyframes mt-wiggle {
  0%, 100% { transform: rotate(-4deg);             }
  25%       { transform: rotate(5deg)  scale(1.06); }
  50%       { transform: rotate(-3deg);             }
  75%       { transform: rotate(4deg)  scale(1.04); }
}

/* ── Shadow ring under mascot ── */
.mt-ring {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255,200,0,0.6) 0%, rgba(255,200,0,0) 72%);
  animation: mt-ring-pulse 0.7s ease-in-out infinite alternate;
  z-index: 1;
}

@keyframes mt-ring-pulse {
  0%   { transform: translateX(-50%) scaleX(1);   opacity: 0.6; }
  100% { transform: translateX(-50%) scaleX(0.65); opacity: 0.18; }
}

/* ── Floating sparkles ── */
.mt-sparks {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99998;
}

.mt-spark {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0;
  animation: mt-spark-float var(--dur, 1.8s) var(--delay, 0s) ease-in-out infinite;
}

.mt-spark:nth-child(1) { left: 8%;  top: 18%; --dur: 1.7s; --delay: 0.0s; }
.mt-spark:nth-child(2) { left: 80%; top: 12%; --dur: 2.1s; --delay: 0.3s; }
.mt-spark:nth-child(3) { left: 62%; top: 74%; --dur: 1.5s; --delay: 0.6s; }
.mt-spark:nth-child(4) { left: 20%; top: 70%; --dur: 2.3s; --delay: 0.1s; }
.mt-spark:nth-child(5) { left: 48%; top:  6%; --dur: 1.9s; --delay: 0.5s; }
.mt-spark:nth-child(6) { left: 90%; top: 58%; --dur: 1.6s; --delay: 0.8s; }
.mt-spark:nth-child(7) { left:  3%; top: 46%; --dur: 2.0s; --delay: 0.2s; }
.mt-spark:nth-child(8) { left: 74%; top: 36%; --dur: 1.8s; --delay: 0.9s; }

@keyframes mt-spark-float {
  0%   { opacity: 0;   transform: translateY(0px)   scale(0.6) rotate(0deg);   }
  30%  { opacity: 1;   transform: translateY(-16px) scale(1.0) rotate(20deg);  }
  70%  { opacity: 0.8; transform: translateY(-30px) scale(0.9) rotate(-10deg); }
  100% { opacity: 0;   transform: translateY(-48px) scale(0.5) rotate(30deg);  }
}

/* ── Coloured loading dots ── */
.mt-dots {
  display: flex;
  gap: 10px;
  margin-top: 32px;
}

.mt-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  animation: mt-dot-pulse 1.1s var(--dot-delay, 0s) ease-in-out infinite;
}

.mt-dot:nth-child(1) { background: #FF8FAB; --dot-delay: 0.00s; }
.mt-dot:nth-child(2) { background: #FFCF47; --dot-delay: 0.18s; }
.mt-dot:nth-child(3) { background: #52D9A4; --dot-delay: 0.36s; }
.mt-dot:nth-child(4) { background: #9C7AF5; --dot-delay: 0.54s; }
.mt-dot:nth-child(5) { background: #68D8D6; --dot-delay: 0.72s; }

@keyframes mt-dot-pulse {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40%           { transform: scale(1.4); opacity: 1;   }
}

/* ── "Loading…" label ── */
.mt-label {
  margin-top: 18px;
  font-family: 'Baloo 2', 'Nunito', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #7a5c00;
  letter-spacing: 0.07em;
  animation: mt-label-blink 1.6s ease-in-out infinite;
}

@keyframes mt-label-blink {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1;   }
}
