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

:root {
  --bg: #0f172a;
  --card: #1e293b;
  --primary: #6366f1;
  --accent: #22d3ee;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --success: #10b981;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 75% 15%, #1e1b4b, #0f172a 60%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: var(--text);
}

.container {
  width: 100%;
  max-width: 720px;
}

h1 {
  text-align: center;
  font-size: 2.1rem;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  text-align: center;
  color: var(--muted);
  margin: 0.4rem 0 2rem;
}

.quote-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quote-mark {
  position: absolute;
  top: 0.75rem;
  left: 1.5rem;
  font-size: 5rem;
  font-family: Georgia, serif;
  color: rgba(99, 102, 241, 0.25);
  line-height: 1;
}

.quote-text {
  font-size: 1.35rem;
  line-height: 1.65;
  font-weight: 500;
  color: var(--text);
  min-height: 4.5em;
  transition: opacity 0.3s ease;
}

.quote-text.loading {
  opacity: 0.35;
}

.quote-author {
  text-align: right;
  color: var(--accent);
  font-weight: 700;
  margin-top: 1.25rem;
  font-size: 0.95rem;
}

.quote-author.loading {
  opacity: 0.35;
}

.spinner {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border: 4px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.visible {
  display: block;
}

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

.actions {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.btn {
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.8rem 1.7rem;
  border-radius: 12px;
  transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-3px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn-outline {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover:not(:disabled) {
  background: var(--primary);
}

.btn.copied {
  background: var(--success);
  border-color: var(--success);
}

.source-note {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.2em;
}

@media (max-width: 480px) {
  .quote-text {
    font-size: 1.1rem;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }
}