* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #2a1f6e;
  color: #ffffff;
  font-family: system-ui, sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
  position: fixed;
  inset: 0;
}

#unity-container,
#unity-canvas {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  display: block;
  background: #2a1f6e;
  outline: none;
}

#unity-warning {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  z-index: 40;
  display: none;
  text-align: center;
}

#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: linear-gradient(#6159c8, #2a1f6e) url("loading.png") center / cover no-repeat;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.4s ease;
}

#loading-overlay::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32%;
  background: linear-gradient(to top, rgba(18, 10, 48, 0.78), transparent);
  pointer-events: none;
}

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

.loading-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.loading-footer {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100% - 48px));
  margin: 0 24px 40px;
  padding: 0;
  background: transparent;
}

.loading-bar-track {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: rgba(18, 10, 48, 0.55);
  box-shadow: 0 0 16px rgba(165, 148, 255, 0.55);
}

#loading-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b9a8ff 0%, #ffffff 55%, #d7c9ff 100%);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.85);
  transition: width 0.15s linear;
}

#loading-label {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(197, 184, 255, 0.9);
}

#pwa-install {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 35;
  padding: 10px 16px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #5a52c4;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(165, 148, 255, 0.6);
}

#pwa-install[hidden] {
  display: none;
}
