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

:root {
  --pink: #ff78b2;
  --pink-dark: #e25595;
  --purple: #9b7bff;
  --text: #3b2d52;
  --muted: #7d6f92;
  --card: rgba(255, 255, 255, 0.95);
  --shadow: 0 18px 45px rgba(110, 74, 146, 0.14);
  --bg1: #fff8fc;
  --bg2: #f7f0ff;
  --panel: #ffffff;
  --border: #f0d9ea;
  --success: #2e9b62;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Cairo", sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 16px;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(255, 203, 227, 0.6), transparent 26%),
    radial-gradient(circle at bottom left, rgba(209, 216, 255, 0.85), transparent 34%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
}

.container {
  width: min(760px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.back-link,
.brand {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 800;
}

.back-link {
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--border);
}

.brand {
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--purple));
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 5vw, 38px);
  color: var(--text);
}

.subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
}

.main {
  text-align: center;
  padding: 18px;
  font-size: clamp(20px, 4vw, 30px);
  line-height: 1.9;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: #fff;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.typingArea {
  width: 100%;
  height: 260px;
  margin-top: 18px;
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  font-size: 18px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  color: var(--text);
  background: #fff;
}

.typingArea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 120, 178, 0.12);
}

.typingArea::placeholder {
  color: #b8a9c8;
}

.actions {
  margin-top: 18px;
}

.btn {
  min-width: 160px;
  outline: none;
  border: none;
  font-size: 22px;
  padding: 12px 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border-radius: 16px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 25px rgba(110, 74, 146, 0.18);
}

.btn:active {
  transform: scale(0.97);
}

.result-box {
  display: grid;
  gap: 10px;
  text-align: right;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  width: 100%;
}

.result-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--success);
  text-align: center;
}

.result-item {
  font-size: 17px;
  color: var(--text);
}

.result-item span {
  font-weight: 800;
}

@media (max-width: 600px) {
  body {
    padding: 12px;
  }

  .container {
    padding: 16px;
    border-radius: 22px;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .main {
    font-size: 21px;
    min-height: 100px;
    padding: 14px;
  }

  .typingArea {
    height: 220px;
    font-size: 17px;
  }

  .btn {
    width: 100%;
    font-size: 20px;
  }
}