:root {
  --title-font: 'Princess Sofia';
}
#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#gl:active {
  cursor: grabbing;
}
#tags {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  transition: opacity 0.6s;
}
#tags .tag {
  pointer-events: auto;
}
.haze {
  background: radial-gradient(ellipse at 50% 35%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 60%);
}
.grain {
  opacity: 0.32;
}

#loading {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(ellipse at 50% 45%, #332143, #100c17 72%);
  transition: opacity 0.8s;
}
#loading.hide {
  opacity: 0;
  pointer-events: none;
}
#loading .glow-title {
  font:
    clamp(42px, 8vw, 72px)/1 'Princess Sofia',
    cursive;
  visibility: hidden;
}
#loading .bar {
  width: 180px;
  height: 3px;
  border-radius: 3px;
  background: rgba(141, 98, 175, 0.25);
  overflow: hidden;
}
#loading .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #bf88ea, #8833cb);
  box-shadow: 0 0 8px #aa64e2;
  transition: width 0.3s;
}
#loading p {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.3em;
  color: #cfb5e2;
}

#intro {
  position: fixed;
  left: 50%;
  bottom: max(28px, 6vh);
  transform: translate(-50%, 20px);
  z-index: 30;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.6s,
    transform 0.6s;
  width: min(440px, 90vw);
  padding: 18px 20px 16px;
  border-radius: 20px;
  background: rgba(23, 15, 31, 0.91);
  border: 1px solid #8c61ae;
  box-shadow:
    0 0 30px rgba(172, 102, 228, 0.35),
    0 20px 50px rgba(75, 51, 94, 0.15);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
#intro.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
#intro .k {
  font:
    italic 500 13px 'Cormorant',
    serif;
  letter-spacing: 0.3em;
  color: #d3a8ef;
}
#iline {
  font-family: var(--writing);
  font-size: 22px;
  letter-spacing: 0.04em;
  color: #f0e3fa;
  margin: 4px 0 2px;
  font-weight: 400;
  min-height: 1.5em;
}
#iline .wg {
  font-size: 46px;
}
#isub {
  font-size: 13px;
  letter-spacing: 0.03em;
  color: #d8c1e7;
  min-height: 1.4em;
}
#iact {
  margin-top: 12px;
  min-height: 8px;
}
#imeter {
  width: 160px;
  height: 4px;
  border-radius: 4px;
  margin: 10px auto 0;
  background: rgba(141, 98, 175, 0.2);
  overflow: hidden;
  display: none;
}
#imeter i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #bf88ea, #8833cb);
}

#title {
  position: fixed;
  left: 50%;
  top: max(4.5vh, 22px);
  transform: translate(-50%, -10px);
  z-index: 5;
  pointer-events: none;
  text-align: center;
  opacity: 0;
  transition:
    opacity 1.4s,
    transform 1.4s;
}
#title.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#title .glow-title {
  font-size: min(6vw, 68px);
}
#title .sub {
  display: block;
  margin-top: 0.35em;
  font:
    italic 500 clamp(12px, 1.4vw, 16px) 'Cormorant',
    serif;
  letter-spacing: 0.35em;
  color: #e1c8f5;
  text-shadow:
    0 0 6px #9440d5,
    0 0 14px rgba(136, 51, 203, 0.8);
}
#title.finale .glow-title {
  animation: fin 1.6s ease-in-out 3;
}
@keyframes fin {
  50% {
    text-shadow:
      0 0 2px #fff,
      0 0 10px #b678e7,
      0 0 30px #9440d5,
      0 0 70px rgba(136, 51, 203, 0.9);
  }
}
.hint {
  opacity: 0;
  transition: opacity 0.8s;
}
.hint.show {
  opacity: 1;
}
@media (max-aspect-ratio: 9/10) {
  #title {
    top: max(8vh, 46px);
  }
  #title .glow-title {
    font-size: 10vw;
  }
  #tags .tag {
    font-size: 14px;
    padding: 3px 8px 4px;
    min-width: 44px;
  }
}
