:root {
  color-scheme: light dark;
  --bg: #1b1f27;
  --card: #262b36;
  --accent: #5eead4;
  --text: #f4f6f8;
  --muted: #9aa4b2;
  --danger: #f87171;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Segoe UI", "Hiragino Sans", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 16px;
}

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

h1 {
  margin: 0 0 24px;
  font-size: 1.4rem;
  font-weight: 600;
}

.display {
  font-size: 3.2rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: 24px;
}

.display.running {
  color: var(--accent);
}

.display.finished {
  color: var(--danger);
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  50% { opacity: 0.3; }
}

.presets {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.presets button {
  flex: 1 1 auto;
  min-width: 60px;
}

.custom-form {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.custom-form input {
  width: 0;
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #3c4353;
  background: #1f242e;
  color: var(--text);
  font-size: 1rem;
  text-align: center;
}

.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.95rem;
  background: #333a48;
  color: var(--text);
  transition: background 0.15s ease, transform 0.05s ease;
}

button:hover:not(:disabled) {
  background: #454e60;
}

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

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

#start-btn {
  background: var(--accent);
  color: #10241f;
  font-weight: 600;
}

#start-btn:hover:not(:disabled) {
  background: #4dd0bd;
}

#reset-btn {
  background: transparent;
  border: 1px solid #454e60;
}

.message {
  min-height: 1.2em;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
