* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: white;
  overflow: hidden;
  touch-action: none;
}

#title {
  position: fixed;
  top: 24px;
  left: 0;
  width: 100%;
  z-index: 20;

  text-align: center;

  font-family: "Glacial Indifference", Arial, sans-serif;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.08em;

  color: black;
  pointer-events: none;
}

#game {
  width: 100vw;
  height: 100vh;

  display: flex;
  justify-content: center;
  align-items: center;
}

#game svg {
  width: 100vw;
  height: 100vh;
  display: block;
}

.hidden-level {
  display: none !important;
}

#startOverlay {
  position: fixed;
  inset: 0;
  z-index: 100;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;

  background: rgba(255, 255, 255, 0.92);
}

#startButton {
  padding: 16px 24px;

  border: 2px solid black;
  border-radius: 999px;

  background: white;
  color: black;

  font-family: "Glacial Indifference", Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
}

#sensorStatus {
  max-width: 300px;
  margin: 0;

  text-align: center;
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.35;

  color: black;
}

#endOverlay {
  position: fixed;
  inset: 0;
  z-index: 200;

  display: flex;
  justify-content: center;
  align-items: center;

  background: rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

#endMessage {
  position: relative;
  z-index: 2;
  max-width: 85vw;
  margin: 0;

  text-align: center;
  font-family: "Glacial Indifference", Arial, sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 7vw, 56px);
  line-height: 1.15;
  letter-spacing: 0.02em;

  color: black;
}

#confettiLayer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.confetti {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  opacity: 0.95;
  animation-name: confettiFall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes confettiFall {
  0% {
    transform: translate3d(0, -30px, 0) rotate(0deg);
  }
  100% {
    transform: translate3d(var(--drift), 110vh, 0) rotate(720deg);
  }
}
