/**
 * LOADING SCREEN
 */

.loader {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s ease-out;
}

.loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader.hidden .loader-bar {
  animation-play-state: paused;
}

.loader-content {
  text-align: center;
  padding: 20px;
}

.loader-title {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: clamp(14px, 4.8vw, 26px);
  letter-spacing: 3px;
  color: var(--accent);
  text-shadow:
    3px 3px 0 #000,
    0 0 20px rgba(232, 184, 64, 0.4);
  margin-bottom: 12px;
  line-height: 1.4;
  animation: loaderTitlePulse 1.6s ease-in-out infinite;
}

.loader-subtitle {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: clamp(8px, 2.6vw, 12px);
  letter-spacing: 4px;
  color: var(--text-dim);
  margin-bottom: 26px;
  text-transform: uppercase;
  line-height: 1.6;
}

@keyframes loaderTitlePulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.65; }
}

/* Эквалайзер */
.loader-eq {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 48px;
  margin-bottom: 22px;
}

.loader-bar {
  width: 8px;
  height: 100%;
  background: linear-gradient(180deg, var(--success) 0%, var(--info) 100%);
  box-shadow: 0 0 8px rgba(64, 224, 160, 0.5);
  transform-origin: bottom;
  animation: loaderEqBounce 0.6s ease-in-out infinite alternate;
}

.loader-bar:nth-child(1) { animation-delay: 0s; }
.loader-bar:nth-child(2) { animation-delay: 0.1s; }
.loader-bar:nth-child(3) { animation-delay: 0.2s; }
.loader-bar:nth-child(4) { animation-delay: 0.15s; }
.loader-bar:nth-child(5) { animation-delay: 0.05s; }
.loader-bar:nth-child(6) { animation-delay: 0.25s; }
.loader-bar:nth-child(7) { animation-delay: 0.1s; }

@keyframes loaderEqBounce {
  0%   { transform: scaleY(0.2); }
  100% { transform: scaleY(1); }
}

/* Текст загрузки */
.loader-text {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: clamp(8px, 2.4vw, 11px);
  letter-spacing: 4px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.loader-dots::after {
  content: '';
  animation: loaderDots 1.4s steps(4, end) infinite;
}

@keyframes loaderDots {
  0%, 20%   { content: ''; }
  40%       { content: '.'; }
  60%       { content: '..'; }
  80%, 100% { content: '...'; }
}