/* =========================
   Base + Layout
   ========================= */

:root {
  --bg-main: #020617;
  --bg-card: #020617;
  --bg-card-soft: #020617;
  --bg-elevated: #020617;
  --border-subtle: rgba(31, 41, 55, 0.9);
  --border-strong: rgba(55, 65, 81, 0.95);
  --accent-blue: #2563eb;
  --accent-blue-dark: #1d4ed8;
  --text-primary: #f9fafb;
  --text-muted: #9ca3af;
  --text-soft: #6b7280;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #020617 0, #020617 40%, #020617 100%);
  color: var(--text-primary);
}

body {
  display: flex;
  justify-content: center;
}

.page-root {
  width: 100%;
  max-width: 960px;
  padding: 24px 16px 48px;
}

/* =========================
   Header + Progress
   ========================= */

.page-header {
  text-align: center;
  margin-bottom: 24px;
}

.app-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  margin: 0 0 4px;
}

.app-subtitle {
  margin: 0 0 16px;
  font-size: 0.98rem;
  color: var(--text-soft);
}

.progress-wrapper {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.progress-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.progress-bar {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, #22c55e, #2563eb);
  border-radius: 999px;
  transition: width 0.25s ease-out;
}

/* =========================
   Cards
   ========================= */

.page-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card,
.hero-card {
  background: radial-gradient(circle at top left, #020617 0, #020617 35%, #020617 100%);
  border-radius: 18px;
  border: 1px solid rgba(31, 41, 55, 0.95);
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.85);
  padding: 20px 24px 22px;
}

/* =========================
   Intro / hero
   ========================= */

.hero-header {
  margin-bottom: 16px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.85);
  background: rgba(15, 23, 42, 0.9);
}

.hero-title {
  margin: 10px 0 4px;
  font-size: 1.6rem;
  letter-spacing: 0.01em;
}

.hero-subtitle {
  margin: 0;
  font-size: 0.98rem;
  color: var(--text-muted);
}

.hero-layout {
  display: flex;
  gap: 24px;
  margin-top: 18px;
}

.hero-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.hero-step-number {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 1);
  border: 1px solid rgba(55, 65, 81, 0.9);
}

.hero-step-title {
  font-size: 0.96rem;
  font-weight: 600;
}

.hero-step-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero-cta-block {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.hero-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* =========================
   Scenario section
   ========================= */

#scenario-title {
  margin: 0 0 6px;
  font-size: 1.3rem;
}

.scenario-description {
  margin: 6px 0 16px;
  font-size: 0.96rem;
  color: var(--text-muted);
}

/* Scenario tags (emoji boxes) */

.scenario-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.scenario-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 4px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(55, 65, 81, 0.9);
  color: #e5e7eb;
}

.scenario-tag-emoji {
  font-size: 0.9rem;
}

/* Choices */

.choices-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.choices-container .btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;      /* allow wrap */
  word-wrap: break-word;    /* break long strings */
  line-height: 1.4;
}

/* Outcome text */

.outcome {
  margin-top: 14px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Next button wrapper */

.next-wrapper {
  margin-top: 18px;
  text-align: right;
}

/* Fade transitions between scenarios */

.card.fade-out {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.card.fade-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

/* =========================
   Result section
   ========================= */

.result-title {
  margin-top: 4px;
  font-size: 1.4rem;
}

.archetype-description {
  margin-top: 6px;
  font-size: 0.98rem;
}

.personalised-summary {
  margin-top: 6px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.result-image {
  width: 100%;
  max-width: 820px;
  display: block;
  margin: 18px auto 8px;
  border-radius: 16px;
  border: 2px solid #1d4ed8;
}

/* =========================
   Share / Copy area
   ========================= */

.share-prompt {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin: 10px 0 6px;
}

.share-text-block {
  margin-top: 4px;
}

.share-text-preview {
  margin: 0;
  padding: 10px 12px 12px;
  background: rgba(15, 23, 42, 0.98);
  border-radius: 12px;
  border: 1px solid rgba(31, 41, 55, 0.95);
  font-family: "JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  color: #e5e7eb;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow-y: auto;
}

.copy-btn {
  margin-top: 8px;
  width: 100%;
}

.share-status {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* =========================
   Buttons (shared)
   ========================= */

button {
  font-family: inherit;
  font-size: 100%;
  border: none;
  background: none;
  padding: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  background: transparent;
  color: #e5e7eb;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

/* Main blue pills: hero CTA, choices, download */

.primary-btn,
.hero-cta,
.choices-container .btn {
  background: var(--accent-blue);
  border-color: var(--accent-blue-dark);
  color: var(--text-primary);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.45);
}

.primary-btn:hover,
.hero-cta:hover,
.choices-container .btn:hover {
  background: var(--accent-blue-dark);
  border-color: var(--accent-blue-dark);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.55);
  transform: translateY(-1px);
}

.btn.disabled,
.btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* Dark minimal button for Copy */

.tertiary-btn,
.copy-btn {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(55, 65, 81, 0.9);
  color: #e5e7eb;
  box-shadow: none;
}

.tertiary-btn:hover,
.copy-btn:hover {
  background: rgba(15, 23, 42, 1);
}

/* Make Download Image full width */
#download-image-button {
  width: 100%;
  display: block;
  margin-bottom: 10px;
}

/* =========================
   About creator card
   ========================= */

.about-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 28px;
  border-radius: 16px;
  margin-top: 32px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #ffffff;
}

.about-card p {
  line-height: 1.55;
  color: #cbd5e1;
}

/* Avatar */
.about-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 4px;
  border: 2px solid rgba(255, 255, 255, 0.12);
}

/* Follow button */
.about-follow-btn {
  margin-top: 8px;
  width: fit-content;
  align-self: flex-start;
}

/* =========================
   Footer
   ========================= */

.page-footer {
  text-align: center;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* =========================
   Utilities
   ========================= */

.hidden {
  display: none !important;
}

/* =========================
   Responsive tweaks
   ========================= */

@media (max-width: 768px) {
  .page-root {
    padding: 20px 10px 40px;
  }

  .card,
  .hero-card {
    padding: 18px 16px 20px;
  }

  .app-title {
    font-size: 1.7rem;
  }

  .hero-layout {
    flex-direction: column;
  }

  #scenario-title {
    font-size: 1.1rem;
  }

  .choices-container .btn {
    font-size: 0.9rem;
    padding: 10px 14px;
  }

  #download-image-button,
  .copy-btn,
  .hero-cta {
    width: 100%;
  }

  .about-card {
    padding: 20px;
  }

  .about-avatar {
    width: 64px;
    height: 64px;
  }
}
