:root {
  color-scheme: light dark;

  --bg: #f2f3f7;
  --card-bg: #ffffff;
  --text: #1a1b1e;
  --muted: #6b7280;
  --accent: #4f46e5;
  --accent-contrast: #ffffff;
  --border: #e2e4ea;
  --focus-ring: #4f46e5;
  --shadow: 0 10px 30px rgba(15, 15, 20, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14151a;
    --card-bg: #1f2128;
    --text: #f4f4f6;
    --muted: #9ca0ab;
    --accent: #818cf8;
    --accent-contrast: #14151a;
    --border: #33353d;
    --focus-ring: #a5b4fc;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-width: 280px;
  text-align: center;
}

.card h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.count {
  margin: 0;
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

button {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 600;
  min-width: 3rem;
  min-height: 3rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
}

#increment,
#decrement {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
  font-size: 1.5rem;
  min-width: 3.5rem;
  min-height: 3.5rem;
}

button:hover:not(:disabled) {
  filter: brightness(1.08);
}

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

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

button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
