/* Base layout */
* { box-sizing: border-box; }
:root {
  --bg1: #667eea;
  --bg2: #764ba2;
  --card: rgba(255,255,255,0.12);
  --text: #ffffff;
  --shadow: 0 8px 15px rgba(0,0,0,0.3);
  --radius: 20px;
}

html, body {
  height: 100%;
}
body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  display: grid;
  place-items: center;
}

.container {
  width: min(840px, 92vw);
  display: grid;
  gap: 18px;
  justify-items: center;
  padding: 10px;
}

h1 {
  margin: 0 0 6px 0;
  font-size: clamp(1.6rem, 2.8vw, 2.5rem);
  letter-spacing: 1.5px;
}

.stopwatch {
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 700;
  padding: 18px 36px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  text-align: center;
  min-width: 320px;
}

/* Controls */
.buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

button {
  padding: 12px 18px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease, opacity .2s ease;
  box-shadow: 0 6px 12px rgba(0,0,0,0.25);
  will-change: transform;
}

button:hover { transform: translateY(-1px) scale(1.03); }
button:active { transform: translateY(0); }
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: saturate(0.6);
}

.start { background: #4caf50; }
.pause { background: #ff9800; }
.reset { background: #f44336; }
.lap   { background: #2196f3; }

/* Laps */
.laps {
  width: min(520px, 96vw);
  max-height: 260px;
  overflow: auto;
  background: var(--card);
  border-radius: 16px;
  padding: 10px 10px 4px 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.laps h2 {
  text-align: center;
  font-size: 1.1rem;
  margin: 6px 0 8px;
  font-weight: 600;
  opacity: 0.95;
}

.lap-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.18);
  font-size: 0.98rem;
}

.lap-row:last-child {
  border-bottom: none;
}

.lap-label {
  opacity: 0
}