:root {
  --bg: #0d0d1a;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f0eeff;
  --text-muted: rgba(240, 238, 255, 0.55);
  --accent: #a78bfa;
  --accent-glow: rgba(167, 139, 250, 0.4);
  --accent-2: #f472b6;
  --accent-3: #38bdf8;
  --radius: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  overflow-x: hidden;
  position: relative;
}

/* Animated background orbs */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  animation: drift 12s ease-in-out infinite alternate;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #7c3aed, transparent);
  top: -150px;
  left: -100px;
  animation-duration: 14s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #ec4899, transparent);
  bottom: -100px;
  right: -80px;
  animation-duration: 11s;
  animation-delay: -4s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #0ea5e9, transparent);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-duration: 16s;
  animation-delay: -7s;
}

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 20px) scale(1.08); }
}

/* Main layout */
main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* Header */
header {
  text-align: center;
}

.crown {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 400;
}

/* Compliment card */
.card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  position: relative;
  backdrop-filter: blur(16px);
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 130px;
  display: flex;
  align-items: center;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

.card-inner {
  flex: 1;
  padding-right: 2rem;
}

.quote-mark {
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  color: var(--accent);
  line-height: 0.8;
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

.compliment-text {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text);
  transition: opacity 0.2s ease;
}

.compliment-text.fade {
  opacity: 0;
}

/* Copy button */
.copy-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  padding: 0.5rem;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(167, 139, 250, 0.1);
}

/* Generate button */
.btn-generate {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2.2rem;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.6);
}

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

.btn-generate.loading {
  opacity: 0.7;
  pointer-events: none;
}

.btn-icon {
  display: inline-block;
  transition: transform 0.4s ease;
}

.btn-generate:hover .btn-icon {
  transform: rotate(20deg) scale(1.2);
}

/* Counter */
.counter-section {
  text-align: center;
}

.counter-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.counter {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 0.2s ease;
}

.counter.pop {
  transform: scale(1.3);
}

/* Category filter */
.category-filter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.filter-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pill {
  padding: 0.4rem 1.1rem;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}

.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pill.active {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.4);
}

/* Footer */
footer {
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 20, 60, 0.95);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
  .card { padding: 1.5rem; }
  .compliment-text { font-size: 1rem; }
}
