body.is-loading::before,
body.is-loading::after {
  content: "";
  position: fixed;
  z-index: 9999;
}

/* Tmavá vrstva přes celou obrazovku – blokuje kliky */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.is-loading::before {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Rotující kolo uprostřed obrazovky */
body::after {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  box-sizing: border-box;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  background-color: transparent;
  -webkit-mask-image: none;
		  mask-image: none;
  -webkit-mask-repeat: no-repeat;
		  mask-repeat: no-repeat;
  -webkit-mask-position: center;
		  mask-position: center;
  -webkit-mask-size: 48px 48px;
		  mask-size: 48px 48px;

  transition: opacity 0.3s ease, visibility 0.3s ease,
			  border-color 0.3s ease, background-color 0.3s ease;
}

body.is-loading::after {
  opacity: 1;
  visibility: visible;
  animation: loader-spin 0.8s linear infinite;
}

@keyframes loader-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Stav "hotovo" – kruh i check jsou v jedné masce, obojí zelené */
body.is-loading.well-done::after {
  animation: none;
  border-color: transparent;      /* původní border nahradí maska */
  background-color: #2ecc71;

  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='21' fill='none' stroke='black' stroke-width='5'/%3E%3Cpath d='M14 25l7 7 14-14' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
		  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='21' fill='none' stroke='black' stroke-width='5'/%3E%3Cpath d='M14 25l7 7 14-14' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}