:root {
  --bg: #0f1220;
  --panel: #171b2e;
  --accent: #7ee787;
  --accent2: #ff9f6b;
  --text: #f2f4ff;
  --muted: #9aa0c0;
  --border: #2a2f4a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1c2140, #0f1220 70%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  justify-content: center;
  padding: 40px 16px;
}

.wrap { width: 100%; max-width: 780px; }

header { text-align: center; margin-bottom: 24px; }
header h1 { margin: 0 0 4px; font-size: 2rem; }
.subtitle { color: var(--muted); font-style: italic; margin: 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.lang-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 14px;
}
.lang-label {
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  background: #1f2440;
  min-width: 100px;
  text-align: center;
}
#swapBtn {
  background: var(--accent);
  border: none;
  color: #0f1220;
  font-size: 1.1rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
}
#swapBtn:hover { background: var(--accent2); }

.boxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .boxes { grid-template-columns: 1fr; }
}

textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  background: #0f1220;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 1rem;
  font-family: inherit;
}
textarea:focus { outline: 2px solid var(--accent); }

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
#translateBtn {
  background: var(--accent);
  border: none;
  color: #0f1220;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
}
#translateBtn:hover { background: var(--accent2); }
#translateBtn:disabled { opacity: 0.6; cursor: default; }

.status { color: var(--muted); font-size: 0.9rem; }

.define-panel {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  color: var(--muted);
}
.define-panel summary { cursor: pointer; color: var(--text); font-weight: 600; }
.define-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.define-row input, .define-row select {
  background: #0f1220;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.9rem;
}
.define-row input { flex: 1; min-width: 140px; }
.define-row button {
  background: var(--accent2);
  border: none;
  color: #0f1220;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 20px;
  line-height: 1.5;
}
