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

body {
  font-family: sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
}

.container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 32px 24px;
  width: 100%;
  max-width: 480px;
}

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 28px;
  color: #333;
}

.display {
  text-align: center;
  margin-bottom: 28px;
}

#time {
  font-size: 3.6rem;
  font-weight: 300;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  color: #222;
}

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  min-width: 90px;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn:not(:disabled):active {
  transform: scale(0.96);
}

.btn-primary {
  background: #4a90d9;
  color: #fff;
}

.btn-primary:not(:disabled):hover {
  background: #3a7bc8;
}

.btn-primary.running {
  background: #e74c3c;
}

.btn-primary.running:not(:disabled):hover {
  background: #c0392b;
}

.btn-secondary {
  background: #6c757d;
  color: #fff;
}

.btn-secondary:not(:disabled):hover {
  background: #5a6268;
}

.btn-danger {
  background: #f0f0f0;
  color: #555;
}

.btn-danger:not(:disabled):hover {
  background: #e0e0e0;
}

.lap-header {
  display: grid;
  grid-template-columns: 60px 1fr 1fr;
  gap: 8px;
  font-size: 0.78rem;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 8px;
  border-bottom: 1px solid #eee;
  margin-bottom: 4px;
}

#lapList {
  list-style: none;
  max-height: 300px;
  overflow-y: auto;
}

#lapList li {
  display: grid;
  grid-template-columns: 60px 1fr 1fr;
  gap: 8px;
  padding: 10px 8px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  align-items: center;
}

#lapList li:last-child {
  border-bottom: none;
}

#lapList li .lap-num {
  color: #888;
  font-size: 0.85rem;
}

#lapList li.fastest {
  color: #27ae60;
  font-weight: 600;
}

#lapList li.slowest {
  color: #e74c3c;
  font-weight: 600;
}

@media (max-width: 480px) {
  #time {
    font-size: 2.8rem;
  }

  .btn {
    padding: 10px 18px;
    min-width: 80px;
    font-size: 0.95rem;
  }
}
