﻿* {
  box-sizing: border-box;
}

#unity-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent !important;
}

#unity-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: transparent !important;
  outline: none;
  touch-action: none;
}

#unity-warning {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  text-align: center;
  display: none;
  background: rgba(0, 0, 0, 0.75);
  padding: 6px 12px;
  border-radius: 6px;
}

html.bc-mobile #unity-canvas {
  cursor: none !important;
}

/* Splash */
#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    1200px 600px at 50% 20%,
    #0f1116 0%,
    #0b0c10 60%,
    #08090c 100%
  );
  color: #e5e7eb;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

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

.splash-center {
  position: relative;
  display: grid;
  place-items: center;
}

#splash-logo {
  width: clamp(200px, 40vmin, 1000px);
  height: auto;
  display: block;
  filter: drop-shadow(0 0 24px rgba(153, 69, 255, 0.45));
  animation: splashDepth 0.9s cubic-bezier(0.25, 0.8, 0.25, 1) both;
  will-change: transform, opacity, filter;
}

.splash-spinner {
  position: absolute;
  width: calc(clamp(200px, 40vmin, 1000px) * 1.3);
  height: calc(clamp(200px, 40vmin, 1000px) * 1.3);
  border-radius: 50%;
  border: 6px solid rgba(153, 69, 255, 0.2);
  border-top-color: #9945ff;
  animation: spin 1s linear infinite, pulseGlow 3s ease-in-out infinite;
  box-shadow: 0 0 40px rgba(153, 69, 255, 0.25);
}

.splash-percent {
  margin-top: 18px;
  font: 600 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Arial, sans-serif;
  color: #cfd4e5;
  letter-spacing: 0.04em;
}

.splash-bar {
  width: min(45vw, 300px);
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.splash-bar-fill {
  height: 100%;
  width: 1%;
  background: linear-gradient(90deg, #19fb9b, #9945ff);
  border-radius: 999px;
  transition: width 0.15s ease;
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(153, 69, 255, 0.25);
    border-color: rgba(153, 69, 255, 0.2);
  }

  50% {
    box-shadow: 0 0 40px rgba(153, 69, 255, 0.45);
    border-color: rgba(153, 69, 255, 0.35);
  }
}

@keyframes splashDepth {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.85);
    filter: blur(10px);
  }

  60% {
    opacity: 1;
    transform: translateY(0) scale(1.05);
    filter: blur(0);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: none;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
