:root {
  color-scheme: light dark;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, #263449 0%, #131a27 45%, #0b111d 100%);
  color: #e8edf7;
}

.app {
  width: min(900px, 92vw);
  padding: 2rem;
  border-radius: 18px;
  background: rgba(16, 24, 39, 0.78);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

h1 {
  margin: 0;
  text-align: center;
}

.subtitle {
  margin: 0.8rem auto 1.6rem;
  text-align: center;
  color: #b9c7e5;
}

.groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.4rem;
}

.group-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.group-item input {
  width: 18px;
  height: 18px;
}

.new-word-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #5271ff, #8456ff);
  cursor: pointer;
}

.new-word-btn:hover {
  filter: brightness(1.08);
}

.controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.7rem;
}

.toggle-timer-btn {
  border: none;
  border-radius: 12px;
  padding: 0.4rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #e8edf7;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  width: 50px;
}

.toggle-timer-btn i {
  font-size: 1.2rem;
  line-height: 1;
}

.toggle-timer-btn:hover:enabled {
  filter: brightness(1.08);
}

.toggle-timer-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.display {
  margin-top: 1.5rem;
  min-height: 220px;
  display: grid;
  place-content: center;
  gap: 0.8rem;
  text-align: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.word-output {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.group-output {
  margin: 0;
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: #b9c7e5;
}

.timer-output {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 600;
  color: #8fe4a5;
}
