:root {
  color-scheme: dark light;
  --bg: radial-gradient(circle at 20% 20%, #ff9a9e, #fecfef, #fe99c0);
  --text-color: #2d0033;
  --button-bg: rgba(255, 255, 255, 0.85);
  --button-text: #832161;
  --shadow: 0 1rem 2.5rem rgba(63, 0, 92, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Comic Sans MS", "Comic Sans", cursive;
  background: var(--bg);
  color: var(--text-color);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.wrapper {
  max-width: 40rem;
  padding: 2.5rem 2rem;
  backdrop-filter: blur(6px);
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: 2rem;
  box-shadow: var(--shadow);
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 1rem;
}

p {
  font-size: 1.125rem;
  line-height: 1.5;
}

button {
  margin-top: 2rem;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--button-text);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 1.25rem 2.5rem rgba(0, 0, 0, 0.25);
}

button.active {
  background: linear-gradient(135deg, #ffde59, #ff7eb3);
  color: #4a004f;
}

.poop {
  position: fixed;
  top: -6rem;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  animation: fall 2.2s cubic-bezier(0.33, 0, 0.67, 1) forwards;
  pointer-events: none;
  filter: drop-shadow(0 0.75rem 1rem rgba(0, 0, 0, 0.35));
  transform: rotate(calc(var(--spin, 0) * 1deg));
}

.poop::after {
  content: "💩";
}

@keyframes fall {
  0% {
    transform: translateY(-20vh) rotate(0deg);
    opacity: 0.9;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(360deg);
    opacity: 0;
  }
}

.confetti {
  position: fixed;
  top: -10vh;
  width: 0.5rem;
  height: 1.4rem;
  background: linear-gradient(135deg, #ff007b, #ffda2d);
  animation: sprinkle 2.4s ease-in forwards;
  pointer-events: none;
  transform: rotate(45deg);
}

@keyframes sprinkle {
  0% {
    opacity: 0.8;
    transform: translateY(-10vh) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(110vh) rotate(720deg);
  }
}

#scoreboard {
  margin-top: 2rem;
  text-align: left;
}

#scoreboard h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

#scores-list {
  list-style: none;
  padding: 0;
  max-height: 20rem;
  overflow-y: auto;
}

#scores-list li {
  padding: 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: var(--button-bg);
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
  max-width: 20rem;
  width: 90%;
}

#pseudo-input {
  padding: 0.5rem;
  margin: 1rem 0;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

#submit-pseudo {
  padding: 0.5rem 1rem;
  background: var(--button-bg);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
}
