html.chikuwa-loading body::before,
html.chikuwa-leaving body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: #f6c70c;
  opacity: 1;
  pointer-events: all;
}

html.chikuwa-loading body::after,
html.chikuwa-leaving body::after {
  content: "LOADING";
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 10000;
  width: min(260px, calc(100vw - 48px));
  color: #fff;
  font-family: "Press Start 2P", system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.20);
  transform: translate(-50%, -50%);
  animation: chikuwaLoadingText 1.2s steps(1, end) infinite;
  pointer-events: none;
}

html.chikuwa-loading::after,
html.chikuwa-leaving::after {
  content: "";
  position: fixed;
  left: 50%;
  top: calc(50% - 52px);
  z-index: 9999;
  width: 42px;
  height: 42px;
  background: url("../img/onden_ico.svg") center / contain no-repeat;
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
  animation: chikuwaLoaderSpin 0.9s linear infinite;
  pointer-events: none;
}

html.chikuwa-ready:not(.chikuwa-leaving) body::before,
html.chikuwa-ready:not(.chikuwa-leaving) body::after,
html.chikuwa-ready:not(.chikuwa-leaving)::after {
  animation: chikuwaLoaderOut 0.18s ease forwards;
  pointer-events: none;
}

@keyframes chikuwaLoadingText {
  0% { content: "LOADING."; }
  25% { content: "LOADING.."; }
  50% { content: "LOADING..."; }
  75% { content: "LOADING"; }
}

@keyframes chikuwaLoaderSpin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes chikuwaLoaderOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}
