/* ============================
   CSS Reset & Variables
   ============================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Ensure the HTML hidden attribute always wins over display rules */
[hidden] {
  display: none !important;
}

:root {
  --bg-deep:       #050a1a;
  --bg-mid:        #071226;
  --bg-card:       rgba(10, 25, 60, 0.80);
  --bg-card-hover: rgba(12, 30, 72, 0.92);
  --accent-blue:   #4a9eff;
  --accent-purple: #8b5cf6;
  --accent-teal:   #2dd4bf;
  --accent-pink:   #f472b6;
  --text-primary:  #e8f0ff;
  --text-muted:    #7ea8d8;
  --border-glow:   rgba(74, 158, 255, 0.30);
  --shadow-card:   0 8px 40px rgba(0, 20, 80, 0.60);
  --radius-card:   24px;
  --radius-btn:    50px;
  --transition:    0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================
   Base
   ============================ */
html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: radial-gradient(ellipse at 20% 30%, #0d1f4a 0%, var(--bg-deep) 60%),
              radial-gradient(ellipse at 80% 70%, #0a1a40 0%, var(--bg-deep) 60%);
  background-color: var(--bg-deep);
  font-family: 'Nunito', sans-serif;
  color: var(--text-primary);
  overflow-x: hidden;
}

/* ============================
   Star Background
   ============================ */
.stars, .stars2, .stars3 {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Stars are generated by JS, but we add a CSS fallback twinkle */
@keyframes twinkle {
  0%, 100% { opacity: 0.8; }
  50%       { opacity: 0.2; }
}

@keyframes twinkle-slow {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 0.1; }
}

/* ============================
   Layout
   ============================ */
.container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem 3rem;
  gap: 2rem;
}

/* ============================
   Header
   ============================ */
.header {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: center;
  width: 100%;
  max-width: 800px;
  justify-content: center;
}

.title-group {
  flex: 1;
}

.title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  font-weight: 600;
  background: linear-gradient(135deg, #a8d4ff 0%, #c4b5fd 50%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-shadow: none;
}

.subtitle {
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  font-weight: 400;
}

.planet {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  animation: float 6s ease-in-out infinite;
  display: block;
  flex-shrink: 0;
}

.planet-left  { animation-delay: 0s; }
.planet-right { animation-delay: 3s; }

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

/* ============================
   Card
   ============================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  width: 100%;
  max-width: 760px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ============================
   Category Section
   ============================ */
.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 0.5rem;
  background: rgba(74, 158, 255, 0.06);
  border: 1px solid rgba(74, 158, 255, 0.20);
  border-radius: 16px;
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--transition),
              border-color var(--transition),
              transform var(--transition),
              box-shadow var(--transition);
  user-select: none;
}

.category-btn:hover {
  background: rgba(74, 158, 255, 0.14);
  border-color: rgba(74, 158, 255, 0.50);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(74, 158, 255, 0.20);
}

.category-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.category-btn.active {
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.25), rgba(139, 92, 246, 0.20));
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue), 0 4px 20px rgba(74, 158, 255, 0.30);
}

.category-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.category-name {
  color: var(--text-primary);
}

/* ============================
   Compliment Section
   ============================ */
.compliment-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.compliment-display {
  width: 100%;
  min-height: 160px;
  background: rgba(5, 12, 35, 0.60);
  border: 1px solid var(--border-glow);
  border-radius: 18px;
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.compliment-display::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(74, 158, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.compliment-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
}

.placeholder-icon {
  font-size: 2rem;
  animation: pulse-star 2s ease-in-out infinite;
}

@keyframes pulse-star {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50%       { transform: scale(1.15); opacity: 1; }
}

.compliment-placeholder p {
  font-size: 0.95rem;
  font-style: italic;
}

.compliment-text {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.6;
  color: var(--text-primary);
  font-style: italic;
  quotes: "\201C" "\201D";
  animation: fade-in 0.5s ease;
}

.compliment-text::before {
  content: open-quote;
  font-size: 2.5em;
  line-height: 0;
  vertical-align: -0.4em;
  color: var(--accent-blue);
  opacity: 0.7;
  margin-right: 0.1em;
}

.compliment-text::after {
  content: close-quote;
  font-size: 2.5em;
  line-height: 0;
  vertical-align: -0.4em;
  color: var(--accent-blue);
  opacity: 0.7;
  margin-left: 0.1em;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================
   Buttons
   ============================ */
.compliment-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 2.2rem;
  background: linear-gradient(135deg, #2563eb, #4a9eff, #818cf8);
  background-size: 200% 200%;
  background-position: 0% 50%;
  border: none;
  border-radius: var(--radius-btn);
  color: #fff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-position var(--transition),
              transform var(--transition),
              box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(74, 158, 255, 0.40);
  letter-spacing: 0.01em;
}

.compliment-btn:hover {
  background-position: 100% 50%;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(74, 158, 255, 0.55);
}

.compliment-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 12px rgba(74, 158, 255, 0.35);
}

.compliment-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.btn-icon {
  font-size: 1.1rem;
  animation: spin-star 4s linear infinite;
}

@keyframes spin-star {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  background: rgba(74, 158, 255, 0.10);
  border: 1px solid rgba(74, 158, 255, 0.30);
  border-radius: var(--radius-btn);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition),
              color var(--transition),
              border-color var(--transition);
}

.copy-btn:hover {
  background: rgba(74, 158, 255, 0.20);
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.copy-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* ─── Action Row ─────────────────────────────────────────────────────────── */
.action-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ─── Share Button ───────────────────────────────────────────────────────── */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  background: rgba(45, 212, 191, 0.10);
  border: 1px solid rgba(45, 212, 191, 0.30);
  border-radius: var(--radius-btn);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition),
              color var(--transition),
              border-color var(--transition);
}

.share-btn:hover {
  background: rgba(45, 212, 191, 0.20);
  border-color: var(--accent-teal);
  color: var(--text-primary);
}

.share-btn:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

.share-icon {
  font-size: 0.9rem;
}

/* ============================
   Footer
   ============================ */
.footer {
  color: var(--text-muted);
  font-size: 0.8rem;
  opacity: 0.7;
  text-align: center;
}

.footer-link {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition), opacity var(--transition);
}

.footer-link:hover {
  color: #93c5fd;
  opacity: 1;
  text-decoration: underline;
}

/* ============================
   Responsive tweaks
   ============================ */
@media (max-width: 600px) {
  .planet {
    display: none;
  }

  .header {
    justify-content: center;
  }

  .card {
    gap: 1.5rem;
  }
}

