:root {
  --bg-1: #f7f1e5;
  --bg-2: #d9e7ff;
  --ink: #222;
  --muted: #5b5b5b;
  --card: rgba(255, 255, 255, 0.86);
  --border: #d3d9e4;
  --accent: #0f766e;
  --accent-2: #ec4899;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "M PLUS 1p", "Segoe UI", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, #fff7cc 0%, transparent 38%),
    radial-gradient(circle at 88% 18%, #ffd6ec 0%, transparent 32%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2));
}

.app {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 16px 48px;
  display: grid;
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: blur(8px);
  animation: rise 420ms ease;
}

h1,
h2,
h3 {
  margin: 0 0 10px;
}

h1 {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
}

.subtitle {
  margin-top: 0;
  color: var(--muted);
}

.featured-fonts {
  border: 1px solid #f3c5de;
  background: linear-gradient(120deg, #fff7df, #ffe9f4);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.featured-title {
  margin: 0 8px 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #7a284f;
}

.font-chip {
  margin-top: 0;
  border: 1px solid #f3a6cb;
  border-radius: 999px;
  padding: 7px 11px;
  background: #fff;
  color: #5a1c3e;
  font-weight: 700;
  cursor: pointer;
  transition: all 180ms ease;
}

.font-chip:hover {
  transform: translateY(-1px);
  background: #fff7fd;
  filter: none;
}

.font-chip.active {
  background: linear-gradient(90deg, #ef4da5, #ff9f43);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 16px rgba(239, 77, 165, 0.28);
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
  font-size: 0.92rem;
}

select,
input,
textarea,
button {
  border: 1px solid #bcc6d5;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 160px;
  line-height: 1.8;
  background: #fff;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

textarea:focus,
select:focus,
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.17);
}

button {
  margin-top: 14px;
  border: none;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: transform 180ms ease, filter 180ms ease;
}

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

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

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  margin-top: 12px;
}

.inline-select {
  min-width: 140px;
}

.secondary {
  background: linear-gradient(90deg, #475569, #64748b);
}

.translation-panel {
  margin-top: 12px;
  border: 1px solid #dfe7f3;
  border-radius: 14px;
  padding: 12px;
  background: #f8fbff;
}

.translation-panel p {
  margin: 0;
  white-space: pre-wrap;
}

.status {
  min-height: 1.2em;
  margin-top: 10px;
  font-weight: 600;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

article {
  border: 1px solid #d8deea;
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
}

article p {
  margin: 0;
  white-space: pre-wrap;
}

.full {
  grid-column: 1 / -1;
}

.grammar-item {
  border-left: 4px solid var(--accent);
  background: #f6fbfb;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.grammar-item p {
  margin: 6px 0;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 700px) {
  .card {
    padding: 16px;
    border-radius: 18px;
  }

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