#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(ellipse at center, rgba(30, 20, 10, .4) 0%, #000 70%), url('../img/bg.jpg') center/cover fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity .6s ease;
  font-family: 'SourceHanSansSC', 'Segoe UI', system-ui, sans-serif
}

#loader.hidden {
  opacity: 0;
  pointer-events: none
}

.loader-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--gold, #d4a843);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 4s ease-in-out infinite
}

@keyframes particleFloat {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0
  }

  20% {
    opacity: .8
  }

  80% {
    opacity: .4
  }

  100% {
    transform: translateY(-120px) scale(.3);
    opacity: 0
  }
}

.loader-ring {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1.5px solid rgba(212, 168, 67, .3);
  animation: ringPulse 2.5s ease-out infinite
}

.loader-ring:nth-child(2) {
  animation-delay: .8s
}

@keyframes ringPulse {
  0% {
    transform: scale(.6);
    opacity: .8
  }

  100% {
    transform: scale(2);
    opacity: 0
  }
}

.loader-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  margin-bottom: 20px
}

.loader-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  position: relative;
  z-index: 2;
  filter: brightness(1) drop-shadow(0 0 12px rgba(212, 168, 67, .4));
  animation: logoGlow 2.5s ease-in-out infinite
}

@keyframes logoGlow {

  0%,
  100% {
    filter: brightness(1) drop-shadow(0 0 8px rgba(212, 168, 67, .3))
  }

  50% {
    filter: brightness(1.15) drop-shadow(0 0 20px rgba(212, 168, 67, .6))
  }
}

.loader-status {
  font-size: .85rem;
  color: rgba(255, 255, 255, .35);
  margin-bottom: 16px
}

.loader-status .dot {
  display: inline-block;
  animation: dotFade 1.5s ease-in-out infinite
}

.loader-status .dot:nth-child(2) {
  animation-delay: .3s
}

.loader-status .dot:nth-child(3) {
  animation-delay: .6s
}

@keyframes dotFade {

  0%,
  100% {
    opacity: .2
  }

  50% {
    opacity: 1
  }
}

.loader-bar-track {
  width: 400px;
  height: 5px;
  background: rgba(255, 255, 255, .08);
  border-radius: 2px;
  overflow: hidden;
  position: relative
}

.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-dark, #b8922e), var(--gold, #d4a843), var(--gold-light, #f0d080));
  border-radius: 2px;
  position: relative
}

.loader-pct {
  font-size: .8rem;
  color: rgba(212, 168, 67, .6);
  margin-top: 8px;
  font-variant-numeric: tabular-nums
}

.loader-wave {
  position: absolute;
  bottom: 40px;
  display: flex;
  gap: 4px
}

.loader-wave span {
  display: block;
  width: 3px;
  height: 20px;
  background: var(--gold, #d4a843);
  border-radius: 2px;
  animation: waveAnim 1.2s ease-in-out infinite
}

.loader-wave span:nth-child(1) {
  animation-delay: 0s;
  height: 14px
}

.loader-wave span:nth-child(2) {
  animation-delay: .15s;
  height: 20px
}

.loader-wave span:nth-child(3) {
  animation-delay: .3s;
  height: 26px
}

.loader-wave span:nth-child(4) {
  animation-delay: .45s;
  height: 20px
}

.loader-wave span:nth-child(5) {
  animation-delay: .6s;
  height: 14px
}

@keyframes waveAnim {

  0%,
  100% {
    transform: scaleY(.5);
    opacity: .3
  }

  50% {
    transform: scaleY(1);
    opacity: .8
  }
}

.page-content {
  display: none
}

#toast {
  display: block;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  background: rgba(0, 0, 0, .9);
  border: 1px solid rgba(212, 168, 67, .3);
  border-radius: 16px;
  padding: 32px 40px;
  text-align: center;
  min-width: 320px;
  backdrop-filter: blur(12px);
  transition: opacity .2s ease, visibility .2s ease
}

#toast.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  animation: toastIn .3s ease-out forwards
}

@keyframes toastIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.85)
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1)
  }
}

#toastTitle {
  color: #d4a843;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px
}

#toastBody {
  color: #e8e8e8;
  font-size: .95rem;
  line-height: 1.6;
  white-space: pre-line;
  margin-bottom: 20px
}

#content,
#player,
footer,
nav.navbar {
  opacity: 0;
  transition: opacity .8s ease
}

body.loaded #content,
body.loaded #player,
body.loaded footer,
body.loaded nav.navbar {
  opacity: 1
}

#player {
  opacity: 0;
  transition: opacity .8s ease, width .35s cubic-bezier(.4, 0, .2, 1), border-radius .35s
}

body.loaded #player {
  opacity: 1
}