:root {
  --bg: #0e1013;
  --panel: #171a1f;
  --panel-2: #1e222a;
  --text: #eef1f6;
  --muted: #8b93a7;
  --accent: #7c5cff;
  --accent-2: #00d4ff;
  --radius: 16px;
}

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

body {
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #23204a 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 30%, #10343d 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

/* ===== Шапка ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  background: rgba(14, 16, 19, 0.75);
  z-index: 10;
}

.title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn-generate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 24px rgba(124, 92, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.5);
  filter: brightness(1.08);
}

.btn-generate:active {
  transform: translateY(0) scale(0.97);
}

.btn-generate:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.btn-icon {
  font-size: 16px;
}

/* ===== Основная сцена ===== */
.stage {
  flex: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Строка ввода с фоновым текстом */
.input-row {
  position: relative;
}

.prompt-input {
  width: 100%;
  padding: 18px 22px;
  font-size: 17px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.prompt-input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.prompt-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.18);
}

/* ===== Место результата ===== */
.output {
  flex: 1;
  min-height: 320px;
  background: var(--panel-2);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: calc(var(--radius) + 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.output-placeholder {
  color: var(--muted);
  font-size: 16px;
  letter-spacing: 0.3px;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.output-result {
  font-size: 20px;
  line-height: 1.6;
  font-weight: 600;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-2));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 3s linear infinite, pop 0.4s ease;
}

@keyframes shine {
  to { background-position: 200% center; }
}

@keyframes pop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Результат-картинка */
.output-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  animation: pop 0.45s ease;
}

.output-image img {
  max-width: 100%;
  max-height: 380px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.output-image figcaption {
  color: var(--muted);
  font-size: 15px;
}

.output.loading .output-placeholder {
  display: none;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 560px) {
  .topbar { padding: 14px 18px; }
  .title { font-size: 22px; }
  .btn-generate { padding: 10px 16px; font-size: 14px; }
}
