@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

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

body {
  min-height: 100vh;

  font-family: "Inter", sans-serif;

  background:
    radial-gradient(
      circle at 15% 15%,
      rgba(99, 102, 241, 0.18),
      transparent 30%
    ),
    radial-gradient(
      circle at 85% 80%,
      rgba(14, 165, 233, 0.14),
      transparent 30%
    ),
    #070b17;

  color: #f8fafc;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;
}

.app {
  width: 100%;
  max-width: 900px;
}

.counter-card {
  position: relative;

  background: rgba(15, 23, 42, 0.78);

  border: 1px solid rgba(148, 163, 184, 0.15);

  border-radius: 24px;

  padding: 34px;

  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);

  backdrop-filter: blur(18px);
}

/* Header */

.header {
  display: flex;
  align-items: center;
  gap: 18px;

  margin-bottom: 30px;
}

.logo {
  width: 54px;
  height: 54px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 16px;

  background: linear-gradient(135deg, #6366f1, #8b5cf6);

  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.logo span {
  font-size: 25px;
}

.header h1 {
  font-size: 28px;
  font-weight: 700;

  letter-spacing: -0.8px;
}

.header p {
  margin-top: 6px;

  color: #94a3b8;

  font-size: 14px;
}

/* Editor */

.editor {
  background: rgba(2, 6, 23, 0.55);

  border: 1px solid rgba(148, 163, 184, 0.13);

  border-radius: 18px;

  overflow: hidden;
}

.editor-top {
  height: 48px;

  padding: 0 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid rgba(148, 163, 184, 0.1);

  color: #94a3b8;

  font-size: 13px;
  font-weight: 500;
}

.live-status {
  display: flex;
  align-items: center;
  gap: 7px;

  color: #a5b4fc;
}

.status-dot {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: #22c55e;

  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}

textarea {
  width: 100%;
  min-height: 280px;

  display: block;

  padding: 22px;

  resize: vertical;

  border: none;
  outline: none;

  background: transparent;

  color: #e2e8f0;

  font-family: inherit;
  font-size: 16px;
  line-height: 1.7;

  caret-color: #818cf8;
}

textarea::placeholder {
  color: #475569;
}

textarea:focus {
  background: rgba(15, 23, 42, 0.2);
}

textarea::-webkit-scrollbar {
  width: 8px;
}

textarea::-webkit-scrollbar-track {
  background: transparent;
}

textarea::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
}

textarea::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.35);
}

/* Statistics */

.stats {
  display: grid;

  grid-template-columns: 1fr 1fr auto;

  gap: 14px;

  margin-top: 18px;
}

.stat-card {
  min-height: 92px;

  padding: 18px;

  display: flex;
  align-items: center;

  gap: 14px;

  border-radius: 16px;

  background: rgba(30, 41, 59, 0.55);

  border: 1px solid rgba(148, 163, 184, 0.1);

  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);

  border-color: rgba(129, 140, 248, 0.3);
}

.stat-icon {
  width: 48px;
  height: 48px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 14px;

  font-size: 18px;
  font-weight: 700;
}

.words-icon {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.characters-icon {
  background: rgba(14, 165, 233, 0.15);
  color: #67e8f9;
}

.stat-info {
  display: flex;
  flex-direction: column;

  gap: 4px;
}

.stat-label {
  color: #64748b;

  font-size: 12px;
  font-weight: 500;

  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.stat-info strong {
  font-size: 25px;

  font-weight: 700;

  color: #f8fafc;
}

.clear-btn {
  min-width: 110px;

  border: 1px solid rgba(148, 163, 184, 0.15);

  border-radius: 16px;

  background: rgba(30, 41, 59, 0.55);

  color: #cbd5e1;

  font-family: inherit;
  font-size: 14px;
  font-weight: 600;

  cursor: pointer;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.clear-btn span {
  margin-right: 6px;

  font-size: 17px;
}

.clear-btn:hover {
  background: rgba(99, 102, 241, 0.12);

  color: #a5b4fc;

  border-color: rgba(129, 140, 248, 0.3);

  transform: translateY(-2px);
}

.clear-btn:active {
  transform: translateY(0);
}

/* Footer */

footer {
  margin-top: 20px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  color: #475569;

  font-size: 12px;
}

.separator {
  color: #6366f1;
}

/* Responsive */

@media (max-width: 700px) {
  body {
    padding: 14px;
  }

  .counter-card {
    padding: 22px;

    border-radius: 20px;
  }

  .header h1 {
    font-size: 22px;
  }

  .header p {
    font-size: 13px;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .clear-btn {
    grid-column: 1 / -1;

    min-height: 55px;
  }
}

@media (max-width: 450px) {
  .header {
    align-items: flex-start;
  }

  .logo {
    width: 46px;
    height: 46px;
  }

  .header h1 {
    font-size: 20px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  textarea {
    min-height: 240px;
  }
}
