body {
  font-family: 'Poppins', sans-serif;
  background-color: #0d1117;
  color: #ffffff;
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wrapper {
  width: min(92vw, 520px);
  text-align: center;
}

h1 {
  margin-bottom: 0.5rem;
  color: #58a6ff;
}

.intro {
  margin-top: 0;
  color: #8b949e;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

#start-button {
  background-color: #238636;
  color: #ffffff;
  border: none;
  padding: 0.7rem 1.8rem;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

#start-button:hover:not(:disabled) {
  background-color: #2ea043;
  transform: translateY(-2px);
}

#start-button:disabled {
  background-color: #30363d;
  cursor: not-allowed;
}

.stats {
  display: flex;
  gap: 0.75rem;
  background-color: #161b22;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
}

#reaction-pad {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, #21262d 0%, #161b22 100%);
  color: #8b949e;
  font-size: clamp(1.1rem, 2.5vw, 1.8rem);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.1s ease;
  padding: 1.5rem;
}

#reaction-pad.ready {
  background: linear-gradient(135deg, #2ea043 0%, #238636 100%);
  color: #0d1117;
}

#reaction-pad.waiting {
  background: linear-gradient(135deg, #f0883e 0%, #9e4c20 100%);
  color: #0d1117;
}

#reaction-pad.false-start {
  animation: flashRed 0.7s ease;
}

@keyframes flashRed {
  0% {
    box-shadow: 0 0 0 rgba(248, 56, 56, 0.6);
  }
  100% {
    box-shadow: 0 0 18px rgba(248, 56, 56, 0);
  }
}

.history {
  margin-top: 2.5rem;
  text-align: left;
}

.history h2 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

#history-list {
  list-style: decimal;
  padding-left: 1.5rem;
  color: #c9d1d9;
}

#history-list li {
  margin-bottom: 0.3rem;
}

@media (max-width: 540px) {
  .stats {
    width: 100%;
    justify-content: center;
  }
}
