:root {
  color-scheme: dark;
  --ink: #f7f7f7;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  color: var(--ink);
  background: #000;
}

body {
  min-height: 100dvh;
  touch-action: manipulation;
  user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  cursor: crosshair;
}

#spawnButton {
  position: fixed;
  z-index: 7;
  top: 18px;
  right: 18px;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

#spawnButton:active {
  transform: translateY(1px) scale(0.96);
}

#eggLayer {
  position: absolute;
  inset: 0;
}

.egg {
  position: absolute;
  width: var(--size);
  height: calc(var(--size) * 1.28);
  background-image: url("assets/store-egg.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 18px 18px rgba(255, 255, 255, 0.09));
  will-change: transform;
}

.kyro {
  position: absolute;
  display: grid;
  width: var(--size);
  height: var(--size);
  place-items: center;
  background-image: url("assets/kyroicon.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.28));
  will-change: transform;
}

.kyro::after {
  content: "KYRO";
  display: none;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
}

.kyro.missing {
  background-image: none;
}

.kyro.missing::after {
  display: block;
}

#naloFlash {
  position: fixed;
  z-index: 20;
  display: grid;
  place-items: center;
  width: clamp(110px, 22vw, 220px);
  height: clamp(64px, 12vw, 124px);
  padding: 0;
  background: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.22));
  opacity: 0;
  transform: translate(-50%, -50%) rotate(var(--twist, 0deg)) scale(0.8);
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

#naloFlash.visible {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(var(--twist, 0deg)) scale(1);
}

#naloLogo {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#naloLogo[src=""],
#naloLogo.broken {
  display: none;
}

#naloFlash span {
  display: none;
  color: #fff;
  font-size: clamp(1.45rem, 5vw, 3rem);
  font-weight: 1000;
  letter-spacing: 0;
}

#naloLogo.broken + span {
  display: block;
}

footer {
  position: fixed;
  z-index: 6;
  right: 12px;
  bottom: 10px;
  left: 12px;
  color: rgba(23, 32, 28, 0.66);
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.75rem;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
}

@media (max-width: 640px) {
  #spawnButton {
    width: 44px;
    height: 44px;
    font-size: 1.8rem;
  }

  footer {
    font-size: 0.68rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #naloFlash {
    transition: none;
  }
}
