
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: light dark;
  --accent: light-dark(#666, #fff);
}

:root:has(body.light) {
  color-scheme: light;
}

:root:has(body.dark) {
  color-scheme: dark;
}

body {
  background: light-dark(#f0efea, #1a202c);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 3rem 0 0;
  color: var(--accent);
  transition: all 0.3s ease;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
.stats-container {
  user-select: none;
  margin: 0 0 2rem;
  width: 100%;
  text-align: center;
}

#total {
  color: var(--accent);
  font-size: clamp(2.5rem, 5vw + 1rem, 4rem);
  font-weight: 700;
  transition: all 0.3s ease;
  letter-spacing: -0.02em;
  opacity: 0.4;
}

#total.active {
  opacity: 1;
  transform: scale(1.05);
}

.sub-stats {
  margin-top: 0.5rem;
  font-size: clamp(0.85rem, 2vw, 1rem);
  opacity: 0.7;
  font-weight: 500;
}

.separator {
  margin: 0 1rem;
  opacity: 0.5;
}

textarea {
  font-size: clamp(1rem, 2vw, 1.5rem);
  line-height: 1.6;
  border: 2px solid light-dark(rgba(195, 186, 170, 0.5), rgba(255, 255, 255, 0.15));
  padding: 3rem 2.5rem;
  width: min(92%, 1000px);
  min-height: 450px;
  color: var(--accent);
  background: light-dark(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.05));
  margin: 0 auto 6rem;
  display: block;
  font-family: 'Georgia', 'Times New Roman', serif;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3));
  resize: vertical;
  transition: all 0.3s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1));
  transform: translateY(-2px);
}

textarea::placeholder {
  color: light-dark(rgba(102, 102, 102, 0.5), rgba(255, 255, 255, 0.3));
}

.settings {
  border-top: 1px solid light-dark(rgba(195, 186, 170, 0.5), rgba(255, 255, 255, 0.15));
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  background: light-dark(rgba(255, 255, 255, 0.95), rgba(45, 55, 72, 0.95));
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  transition: all 0.3s ease;
}

.color, .actions {
  display: flex;
}

button {
  padding: 1.5rem 2.5rem;
  border: none;
  border-right: 1px solid light-dark(rgba(195, 186, 170, 0.5), rgba(255, 255, 255, 0.15));
  background: transparent;
  color: var(--accent);
  font-size: clamp(0.8rem, 1.5vw, 0.95rem);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: light-dark(rgba(74, 85, 104, 0.15), rgba(66, 153, 225, 0.2));
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
  z-index: -1;
}

button:hover::before {
  width: 300px;
  height: 300px;
}

button:hover {
  transform: translateY(-1px);
}

button.active {
  background: light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.15));
}

button:active {
  transform: translateY(1px);
}

button:last-child {
  border-right: none;
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-indicator {
  width: 2.5rem;
  height: 1.25rem;
  background: light-dark(rgba(195, 186, 170, 0.5), rgba(255, 255, 255, 0.2));
  border-radius: 1rem;
  position: relative;
  transition: background 0.3s ease;
}

.toggle-indicator::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  background: light-dark(white, #2d3748);
  border-radius: 50%;
  top: 0.125rem;
  left: 0.125rem;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-btn.active .toggle-indicator {
  background: light-dark(var(--accent), rgba(255, 255, 255, 0.9));
}

.toggle-btn.active .toggle-indicator::after {
  transform: translateX(1.25rem);
}

.notification {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: var(--accent);
  color: light-dark(white, #1a202c);
  padding: 1rem 2rem;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  font-weight: 600;
  font-size: clamp(0.85rem, 2vw, 1rem);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.notification.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  body {
    padding: 2rem 0 0;
  }

  textarea {
    padding: 2rem 1.5rem;
    min-height: 350px;
    width: 95%;
    border-radius: 8px;
  }

  .settings {
    flex-direction: column;
  }

  .color, .actions {
    width: 100%;
    justify-content: stretch;
  }

  button {
    flex: 1;
    padding: 1.25rem 0.75rem;
  }

  .notification {
    right: 1rem;
    top: 1rem;
    padding: 0.75rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .separator {
    margin: 0 0.5rem;
  }

  textarea {
    padding: 1.5rem 1rem;
    min-height: 300px;
  }

  button {
    padding: 1rem 0.5rem;
  }
}
