:root {
  --mkg-loader-accent: #20c8ff;
  --mkg-loader-accent-strong: #3478ff;
  --mkg-loader-text: #f7fbff;
  --mkg-loader-muted: #a9bfd3;
}

html, body {
  padding: 0;
  margin: 0;
  background: radial-gradient(circle at 50% 35%, #123a61 0%, #001f3f 58%, #001429 100%);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
}

#unity-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#unity-canvas {
  background: #1a1a1a;
  display: block;
  object-fit: contain;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
}

#unity-loading-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block;
  width: min(88vw, 460px);
  box-sizing: border-box;
  padding: 30px 32px 27px;
  overflow: hidden;
  isolation: isolate;
  color: white;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(34, 157, 225, 0.16), transparent 43%),
    linear-gradient(160deg, rgba(8, 41, 73, 0.985), rgba(0, 22, 46, 0.985));
  border: 1px solid rgba(112, 196, 255, 0.28);
  border-radius: 22px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#unity-loading-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.035), transparent 35%, transparent 65%, rgba(32, 200, 255, 0.035));
}

#unity-logo {
  width: 154px;
  height: 154px;
  margin: 0 auto 16px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

#unity-logo img#unity-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#unity-game-name {
  color: var(--mkg-loader-text);
  font-size: clamp(21px, 3.6vw, 24px);
  font-weight: 750;
  line-height: 1.24;
  text-align: center;
}

#unity-company-name {
  margin-top: 6px;
  margin-bottom: 24px;
  color: var(--mkg-loader-muted);
  font-size: 13px;
  text-align: center;
}

#unity-download-panel {
  padding: 17px 18px 16px;
  background: rgba(0, 13, 31, 0.46);
  border: 1px solid rgba(117, 193, 244, 0.15);
  border-radius: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

#unity-progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#unity-loading-status {
  position: relative;
  min-width: 0;
  padding-left: 17px;
  color: #eaf6ff;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  text-align: left;
}

#unity-loading-status::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mkg-loader-accent);
  box-shadow: 0 0 0 0 rgba(32, 200, 255, 0.46);
  transform: translateY(-50%);
  animation: mkgStatusPulse 1.8s ease-out infinite;
}

#unity-progress-percent {
  flex: 0 0 auto;
  min-width: 49px;
  box-sizing: border-box;
  padding: 4px 9px;
  color: var(--mkg-loader-text);
  background: rgba(32, 200, 255, 0.11);
  border: 1px solid rgba(74, 210, 255, 0.2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

#unity-progress-bar-empty {
  position: relative;
  width: 100%;
  height: 15px;
  box-sizing: border-box;
  margin-top: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.085);
  border: 1px solid rgba(166, 218, 255, 0.14);
  border-radius: 999px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.38), 0 1px 0 rgba(255, 255, 255, 0.025);
}

#unity-progress-bar-full {
  position: relative;
  width: 0%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(90deg, #2078ff 0%, #15baf3 48%, #54e4ff 100%);
  border-radius: inherit;
  box-shadow: 0 0 18px rgba(32, 200, 255, 0.46);
  transition: width 460ms cubic-bezier(0.22, 0.61, 0.36, 1), background 300ms ease;
  will-change: width;
}

#unity-progress-bar-full::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg, transparent 0 10px, rgba(255, 255, 255, 0.2) 10px 16px, transparent 16px 27px);
  background-size: 36px 100%;
  opacity: 0.46;
  animation: mkgProgressFlow 0.78s linear infinite;
}

#unity-progress-bar-full::after {
  content: "";
  position: absolute;
  top: -40%;
  bottom: -40%;
  left: 0;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  filter: blur(2px);
  transform: translateX(-180%) skewX(-16deg);
  animation: mkgProgressSweep 1.7s ease-in-out infinite;
}

#unity-progress-bar-empty.is-indeterminate #unity-progress-bar-full {
  width: 34% !important;
  animation: mkgIndeterminate 1.35s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

#unity-progress-bar-empty.is-complete #unity-progress-bar-full {
  background: linear-gradient(90deg, #1e9eff, #34dcba);
}

#unity-progress-details {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  margin-top: 13px;
  color: #b8cde0;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

#unity-progress-bytes {
  min-width: 0;
  line-height: 1.45;
  text-align: center;
}

#unity-warning {
  position: absolute;
  left: 50%;
  top: 5%;
  z-index: 9999;
  display: none;
  padding: 10px;
  color: black;
  background: white;
  transform: translate(-50%);
}

#custom-loading-spinner {
  margin-top: 23px;
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(32, 200, 255, 0.2);
  border-top-color: var(--mkg-loader-accent);
  border-right-color: rgba(52, 120, 255, 0.85);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.spinner-text {
  color: #94aec4;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes mkgStatusPulse {
  0% { box-shadow: 0 0 0 0 rgba(32, 200, 255, 0.5); }
  65%, 100% { box-shadow: 0 0 0 7px rgba(32, 200, 255, 0); }
}

@keyframes mkgProgressFlow {
  from { background-position: 0 0; }
  to { background-position: 36px 0; }
}

@keyframes mkgProgressSweep {
  0%, 18% { transform: translateX(-180%) skewX(-16deg); opacity: 0; }
  32% { opacity: 0.82; }
  62%, 100% { transform: translateX(310%) skewX(-16deg); opacity: 0; }
}

@keyframes mkgIndeterminate {
  0% { transform: translateX(-115%); }
  100% { transform: translateX(310%); }
}

@media (max-height: 520px) {
  #unity-loading-bar {
    width: min(91vw, 500px);
    padding: 17px 22px 16px;
  }

  #unity-logo {
    width: 82px;
    height: 82px;
    margin-bottom: 9px;
    border-radius: 12px;
  }

  #unity-game-name {
    font-size: 18px;
  }

  #unity-company-name {
    margin-top: 3px;
    margin-bottom: 12px;
  }

  #unity-download-panel {
    padding: 12px 14px 11px;
  }

  #unity-progress-bar-empty {
    margin-top: 10px;
  }

  #unity-progress-details {
    margin-top: 9px;
  }

  #custom-loading-spinner {
    margin-top: 12px;
  }
}

@media (max-width: 420px) {
  #unity-loading-bar {
    width: min(92vw, 410px);
    padding-left: 20px;
    padding-right: 20px;
  }

  #unity-logo {
    width: 132px;
    height: 132px;
  }

  #unity-progress-heading {
    gap: 10px;
  }

  #unity-loading-status {
    font-size: 12.5px;
  }
}

@media (max-width: 420px) and (max-height: 520px) {
  #unity-logo {
    width: 76px;
    height: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #unity-progress-bar-full {
    transition: none;
  }

  #unity-progress-bar-full::before,
  #unity-progress-bar-full::after,
  #unity-progress-bar-empty.is-indeterminate #unity-progress-bar-full,
  #unity-loading-status::before {
    animation: none;
  }

  #unity-progress-bar-empty.is-indeterminate #unity-progress-bar-full {
    transform: translateX(0);
    opacity: 0.45;
  }

  .spinner {
    animation-duration: 1.8s;
  }
}
