/* ========================================
   ローダー専用CSS
======================================== */

/* ローダー表示中はbodyのスクロールを無効化 */
body {
  overflow: hidden;
}

body.loaded {
  overflow: auto;
}

#loader-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: #000000;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s ease;
}

#loader-container.fade-out {
  opacity: 0;
  pointer-events: none;
}

#loader-canvas {
  width: 300px;
  height: 300px;
  display: block;
}

.loader-content {
  text-align: center;
}

.loader-logo {
  margin-bottom: 20px;
}

.loader-logo img {
  height: 50px;
  width: auto;
  opacity: 0.9;
}

.loader-text {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.2em;
  margin-top: 30px;
  text-transform: uppercase;
  animation: pulse 2s ease-in-out infinite;
}

.loader-progress {
  margin: 20px auto 0;
  width: 200px;
}

.loader-progress-bar-container {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1px;
  overflow: hidden;
}

.loader-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ffffff 0%, #999999 100%);
  width: 0%;
  transition: width 0.3s ease;
}

.loader-progress-text {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-family: 'Montserrat', sans-serif;
  margin-top: 10px;
  letter-spacing: 0.1em;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* スピナードット（フォールバック用） */
.loader-spinner {
  display: flex;
  gap: 8px;
  margin-top: 30px;
}

.loader-spinner-dot {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  animation: bounce 1.4s ease-in-out infinite;
}

.loader-spinner-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loader-spinner-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* レスポンシブ */
@media (max-width: 768px) {
  #loader-canvas {
    width: 250px;
    height: 250px;
  }

  .loader-logo img {
    height: 40px;
  }

  .loader-text {
    font-size: 12px;
  }

  .loader-progress {
    width: 160px;
  }
}

@media (max-width: 480px) {
  #loader-canvas {
    width: 200px;
    height: 200px;
  }

  .loader-logo img {
    height: 35px;
  }

  .loader-text {
    font-size: 11px;
  }

  .loader-progress {
    width: 140px;
  }
}
