* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#background {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#background.loaded {
  opacity: 1;
}

.background-pan {
  width: 110%;
  height: 100%;
  position: relative;
  left: -5%;
  animation: pan-background 30s ease-in-out infinite;
}

#background-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@keyframes pan-background {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

#background-overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  background-color: rgba(26, 8, 47);
  background-image: linear-gradient(to bottom left, rgba(26, 8, 47) 0%, rgba(69, 28, 140, 0) 100%);
  backdrop-filter: blur(4px);
  opacity: 0.7;
  -webkit-backdrop-filter: blur(4px);
}

#unity-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 10;
  background: transparent;
  touch-action: none;
}

#back-button {
  position: fixed;
  top: max(0.5rem, env(safe-area-inset-top));
  left: max(0.5rem, env(safe-area-inset-left));
  width: 3rem;
  height: 3rem;
  display: none;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 20;
}

#back-button.visible {
  display: flex;
}

#back-button svg {
  width: 1.5rem;
  height: 1.5rem;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

#loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  z-index: 30;
  transition: opacity 0.3s ease;
}

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

/* LogoOverlay — mirrors src/modules/games/components/LogoOverlay/LogoOverlay.tsx.
   Blob-shaped card (frosted blur + gradient SVG) with the game name, logo, and a
   gradient progress bar; name + logo are populated from CONFIG. */
.logo-overlay {
  position: relative;
  width: 273px;
  height: 284px;
}

.logo-overlay-blur {
  position: absolute;
  inset: 0;
  opacity: 0.75;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  clip-path: path(
    'M0.131364 39.2423C-1.65479 18.1261 15.0029 0 36.1945 0H236.72C257.805 0 274.427 17.9533 272.804 38.9764L256.475 250.593C255.02 269.445 239.298 284 220.39 284H54.0944C35.2887 284 19.6164 269.597 18.0313 250.859L0.131364 39.2423Z'
  );
}

.logo-overlay-shape {
  position: absolute;
  inset: 0;
}

.logo-overlay-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
}

.logo-overlay-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

.logo-overlay-logo {
  width: 9rem;
  height: 9rem;
  object-fit: contain;
}

.logo-overlay-progress {
  position: relative;
  width: 201px;
  height: 41px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.5);
}

.logo-overlay-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 14px;
  background: linear-gradient(90deg, #451c8c 0%, #6d2fd7 100%);
  transition: width 0.3s ease-out;
}

.logo-overlay-progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-overlay-progress-label span {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

#error {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
  color: #fff;
  z-index: 40;
}

#error.visible {
  display: flex;
}
