* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Comic Sans MS', cursive, sans-serif;
  background: linear-gradient(135deg, #ffeaa7, #fab1a0, #74b9ff, #55efc4);
  background-size: 400% 400%;
  animation: bgFlow 20s infinite;
  color: #2d3436;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

@keyframes bgFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.layout {
  display: flex;
  width: 90%;
  height: 90vh;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0 40px #fd79a8;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
}

/* Sidebar */
.sidebar {
  background: #ffeaa7;
  width: 22%;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border-right: 4px dotted #fd79a8;
}

.sidebar h1 {
  font-size: 1.8rem;
  color: #d63031;
  margin-bottom: 2rem;
  text-shadow: 1px 1px #fff;
}

.buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

button {
  padding: 12px 24px;
  font-weight: bold;
  border-radius: 12px;
  border: 3px dashed transparent;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

#startBtn {
  background-color: #6c5ce7;
  color: white;
  border-color: #a29bfe;
}
#startBtn:hover {
  transform: scale(1.1) rotate(-2deg);
  box-shadow: 0 0 10px #a29bfe;
}

#stopBtn {
  background-color: #d63031;
  color: #fff;
  border-color: #fab1a0;
}
#stopBtn:hover {
  transform: scale(1.1) rotate(2deg);
  box-shadow: 0 0 10px #fab1a0;
}

#toggleLeaderboardBtn {
  background: linear-gradient(45deg, #fd79a8, #e17055);
  color: white;
  border-color: #ffeaa7;
}
#toggleLeaderboardBtn:hover {
  transform: rotate(3deg);
  box-shadow: 0 0 10px #fd79a8;
}

.quote-box {
  margin-top: 2rem;
  text-align: center;
  font-style: italic;
  font-size: 1rem;
  color: #636e72;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.card {
  background: #fff;
  padding: 1rem 2rem;
  border-radius: 16px;
  box-shadow: 0 0 12px #00cec9;
  text-align: center;
  transform: rotate(-1deg);
}

.card h3 {
  margin-bottom: 0.5rem;
  color: #6c5ce7;
}

.timer-section h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-family: 'Orbitron', sans-serif;
  text-shadow: 1px 1px #dfe6e9;
}

.detox-status {
  font-size: 1.2rem;
  font-weight: bold;
  color: #00b894;
}

/* Leaderboard */
.leaderboard {
  background: #ffeaa7;
  width: 24%;
  padding: 2rem 1rem;
  border-left: 5px dotted #fd79a8;
  overflow-y: auto;
}

.leaderboard h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #e84393;
  text-shadow: 1px 1px #fff;
}

.leaderboard ul {
  list-style: none;
  padding-left: 0;
  font-size: 1rem;
}

.leaderboard li {
  margin-bottom: 1rem;
  color: #2d3436;
}

/* Responsive */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
    height: auto;
  }

  .sidebar,
  .leaderboard {
    width: 100%;
    text-align: center;
  }

  .main-content {
    width: 100%;
  }

  .stats {
    flex-direction: column;
    align-items: center;
  }

  .leaderboard {
    display: none;
  }
}
