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

body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d0d0d;
  color: #e8e8e8;
  font-family: system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  text-align: center;
  padding: 2rem;
  width: 100%;
  max-width: 480px;
}

h1 {
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 2rem;
}

.display {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;
  font-size: clamp(3rem, 12vw, 5.5rem);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: #fff;
  padding: 1.5rem 0;
  margin-bottom: 2.5rem;
  border-top: 1px solid #222;
  border-bottom: 1px solid #222;
  font-variant-numeric: tabular-nums;
}

.controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

button {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
  border-radius: 6px;
  padding: 0.85rem 2rem;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  min-width: 110px;
}

button:active:not(:disabled) {
  transform: scale(0.97);
}

#startBtn {
  background: #1db954;
  color: #fff;
}

#startBtn:hover:not(:disabled) {
  background: #1ed760;
}

#lapBtn {
  background: #2a6ea8;
  color: #fff;
}

#lapBtn:hover:not(:disabled) {
  background: #3580be;
}

#stopBtn {
  background: #e04040;
  color: #fff;
}

#stopBtn:hover:not(:disabled) {
  background: #e85555;
}

#resetBtn {
  background: #333;
  color: #ccc;
}

#resetBtn:hover:not(:disabled) {
  background: #444;
}

button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.laps {
  list-style: none;
  margin-top: 2rem;
  text-align: left;
  max-height: 300px;
  overflow-y: auto;
}

.laps li {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #1a1a1a;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  color: #bbb;
}

.laps li .lap-label {
  color: #666;
}

.laps li .lap-split {
  color: #555;
  font-size: 0.85rem;
}

@media (max-width: 400px) {
  .controls {
    flex-direction: column;
    align-items: center;
  }

  button {
    width: 100%;
    max-width: 220px;
  }
}
