﻿:root {
  color-scheme: light dark;
  --bg: #0b1021;
  --fg: #f2f5ff;
  --accent: #7a7dfe;
  --accent-dark: #4a4df0;
  --muted: #a0a3c3;
  --card: rgba(255, 255, 255, 0.06);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at top, #1a2247, #070b1a);
  color: var(--fg);
  padding: 24px;
}

.app {
  width: min(960px, 100%);
  background: rgba(7, 11, 26, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 40px 80px rgba(4, 8, 20, 0.45);
  backdrop-filter: blur(12px);
}

.app__header h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.app__header p {
  margin: 0;
  color: var(--muted);
}

.prompt-form {
  margin-top: 28px;
  display: grid;
  gap: 12px;
}

.prompt-form label {
  font-weight: 600;
}

.prompt-form textarea {
  resize: vertical;
  min-height: 90px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 15, 35, 0.8);
  padding: 14px 16px;
  color: var(--fg);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.prompt-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122, 125, 254, 0.35);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.actions button {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#generate-btn {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 24px rgba(122, 125, 254, 0.35);
}

#generate-btn:disabled {
  cursor: not-allowed;
  background: var(--accent-dark);
  box-shadow: none;
  opacity: 0.6;
}

#download-btn {
  background: rgba(255, 255, 255, 0.12);
  color: var(--fg);
}

#download-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.actions button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(122, 125, 254, 0.45);
}

.hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.result {
  margin-top: 32px;
  position: relative;
  min-height: 340px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.placeholder {
  text-align: center;
  color: var(--muted);
  display: grid;
  place-items: center;
  gap: 12px;
}

.placeholder .emoji {
  font-size: 2.4rem;
}

.result__figure {
  margin: 0;
  text-align: center;
  display: grid;
  gap: 12px;
}

.result__figure img {
  width: min(512px, 100%);
  border-radius: 16px;
  box-shadow: 0 24px 40px rgba(8, 12, 32, 0.65);
}

.result__figure figcaption {
  font-size: 0.95rem;
  color: var(--muted);
}

.loader {
  display: grid;
  place-items: center;
  gap: 12px;
}

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

.hidden {
  display: none !important;
}

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

@media (max-width: 640px) {
  .app {
    padding: 24px;
  }

  .result {
    min-height: 280px;
  }
}
