:root {
  color-scheme: light dark;
  --bg: #f4f5f7;
  --card-bg: #ffffff;
  --text: #1c1c1e;
  --accent: #2f6fed;
  --accent-active: #e0393e;
  --muted: #6b7280;
  --border: #e5e7eb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --card-bg: #1a1d24;
    --text: #f4f5f7;
    --muted: #9aa0ac;
    --border: #2a2e37;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  padding: 24px;
}

.card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 40px 32px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

h1 {
  margin: 0 0 24px;
  font-size: 20px;
  font-weight: 600;
  color: var(--muted);
}

.display {
  font-variant-numeric: tabular-nums;
  font-size: 56px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 32px;
}

.buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.btn {
  flex: 1;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

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

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

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary.running {
  background: var(--accent-active);
  border-color: var(--accent-active);
}

.laps {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  text-align: left;
  border-top: 1px solid var(--border);
}

.laps li {
  display: flex;
  justify-content: space-between;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--muted);
}

.laps li span:first-child {
  color: var(--text);
  font-weight: 600;
}
