/* Import fonts once */

@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=MedievalSharp&family=Nova+Oval&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

/* Base reset */

body,
html {
  margin: 0;

  padding: 0;

  overflow: hidden;

  width: 100%;

  height: 100%;
}

/* Background setup */

body {
  background: url("fantasy-castle-b.png") center/cover no-repeat fixed;
}

/* Typography */

body p {
  font-weight: 500;

  font-size: 1rem !important;

  color: #3e181b;
}

/* Canvas styling */

canvas {
  position: absolute;

  top: 0;

  left: 0;

  width: 100vw;

  height: 100vh;

  z-index: 1;
}

/* Music button */

#musicButton {
  position: absolute;

  top: 20px;

  left: 20px;

  padding: 10px 15px;

  background: rgba(0, 0, 0, 0.7);

  color: white;

  border: none;

  cursor: pointer;

  font-size: 13px;

  z-index: 2;

  font-family: "MedievalSharp", serif;

  font-weight: 400;
}

/* Loading screen */

#loadingScreen {
  position: fixed;

  inset: 0;

  background-color: #000000;

  display: flex;

  flex-direction: column;

  justify-content: center;

  align-items: center;

  z-index: 1000;

  transition: opacity 0.5s ease-in-out;
}

.progress-bar {
  width: 300px;

  height: 8px;

  background-color: #1a1a1a;

  border-radius: 4px;

  overflow: hidden;
}

.progress {
  width: 0%;

  height: 100%;

  background-color: #4f46e5;

  transition: width 0.5s ease-in-out;

  border-radius: 4px;
}

.loading-text {
  color: white;

  margin-top: 20px;

  font-size: 1.2rem;
}

/* Pulsating circle */

.pulsating-circle {
  position: absolute;

  left: 54%;

  top: 53%;

  transform: translate(-50%, -50%);

  width: 30px;

  height: 30px;

  z-index: 99999;

  pointer-events: all;

  cursor: pointer;

  opacity: 0.7;
}

.pulsating-circle::before {
  content: "";

  position: relative;

  display: block;

  width: 300%;

  height: 300%;

  box-sizing: border-box;

  margin-left: -100%;

  margin-top: -100%;

  border-radius: 45px;

  background-color: #01a4e9;

  animation: pulse-ring 1.25s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.pulsating-circle::after {
  content: "";

  position: absolute;

  inset: 0;

  background-color: white;

  opacity: 0.8;

  border-radius: 15px;

  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);

  animation: pulse-dot 1.25s cubic-bezier(0.455, 0.03, 0.515, 0.955) -0.4s infinite;
}

/* Pulsating circle */

.pulsating-circle-back {
  position: relative;

  left: 50%;

  bottom: 6% !important;

  /* transform: translate(-50%, -50%); */

  width: 30px;

  height: 30px;

  z-index: 1 !important;

  pointer-events: all;

  cursor: pointer;

  opacity: 0.7;
}

.pulsating-circle-back::before {
  content: "";

  position: relative;

  display: block;

  width: 300%;

  height: 300%;

  box-sizing: border-box;

  margin-left: -100%;

  margin-top: -100%;

  border-radius: 45px;

  background-color: #01a4e9;

  animation: pulse-ring 1.25s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.pulsating-circle-back::after {
  content: "";

  position: absolute;

  inset: 0;

  /* background-color: white; */

  opacity: 0.8;

  border-radius: 15px;

  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);

  animation: pulse-dot 1.25s cubic-bezier(0.455, 0.03, 0.515, 0.955) -0.4s infinite;
}

/* Animations */

@keyframes pulse-ring {
  0% {
    transform: scale(0.33);
  }

  80%,
  100% {
    opacity: 0;
  }
}

@keyframes pulse-dot {
  0% {
    transform: scale(0.8);
  }

  50% {
    transform: scale(1);
  }

  100% {
    transform: scale(0.8);
  }
}

/* Candle and overlay */

#candleCanvas {
  pointer-events: none;

  position: absolute;

  width: 100%;

  height: 100%;
}

.overlay {
  position: fixed;

  inset: 0;

  background-color: rgba(0, 0, 0, 0.3);

  z-index: 50;

  opacity: 0;

  pointer-events: none;

  transition: opacity 0.3s ease;
}

.overlay.active {
  opacity: 1;

  pointer-events: all;
}
