:root {
  --bg: #0e0c12;
  --surface: #17141f;
  --surface2: #1f1a2a;
  --text: #f2eef8;
  --muted: #9a8fb0;
  --accent: #c084fc;
  --accent-dim: #7c3aed;
  --border: rgba(192, 132, 252, 0.22);
  --radius: 14px;
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Outfit", var(--font);
  /* Likert poles (MBTI-style agree / disagree) */
  --likert-agree: #2dd4bf;
  --likert-disagree: #a78bfa;
  --likert-neutral: #6b7280;
}

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

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(124, 58, 237, 0.35), transparent),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(192, 132, 252, 0.08), transparent);
}

a {
  color: var(--accent);
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.35rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.intro-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.disclaimer {
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.btn {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent-dim), #9333ea);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(124, 58, 237, 0.5);
}

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

.btn-ghost:hover:not(:disabled) {
  background: #252030;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.progress-track {
  height: 4px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 4px;
  transition: width 0.25s ease;
}

.question-topic {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--likert-agree);
}

.question-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.65rem;
  letter-spacing: -0.02em;
}

.scale-hint {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

/* MBTI-style 7-point circle scale */
.likert-options {
  margin-top: 0.35rem;
}

.likert-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.5rem 0.85rem;
  flex-wrap: wrap;
  padding: 0.35rem 0 0.25rem;
}

.likert-pole {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding-bottom: 0.35rem;
  user-select: none;
}

.likert-pole--agree {
  color: var(--likert-agree);
}

.likert-pole--disagree {
  color: var(--likert-disagree);
}

.likert-track {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.3rem;
  flex: 1 1 16rem;
  min-width: 0;
  max-width: 22rem;
}

.likert-dot {
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid;
  background: transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition:
    transform 0.12s ease,
    background 0.12s ease,
    box-shadow 0.12s ease;
}

.likert-dot:hover {
  transform: scale(1.07);
}

.likert-dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Size gradient: largest at extremes, smallest in the middle */
.likert-dot--0,
.likert-dot--6 {
  width: 46px;
  height: 46px;
}

.likert-dot--1,
.likert-dot--5 {
  width: 36px;
  height: 36px;
}

.likert-dot--2,
.likert-dot--4 {
  width: 28px;
  height: 28px;
}

.likert-dot--3 {
  width: 22px;
  height: 22px;
}

.likert-dot--0,
.likert-dot--1,
.likert-dot--2 {
  border-color: var(--likert-agree);
}

.likert-dot--0:hover,
.likert-dot--1:hover,
.likert-dot--2:hover {
  background: rgba(45, 212, 191, 0.14);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.25);
}

.likert-dot--3 {
  border-color: var(--likert-neutral);
}

.likert-dot--3:hover {
  background: rgba(107, 114, 128, 0.18);
}

.likert-dot--4,
.likert-dot--5,
.likert-dot--6 {
  border-color: var(--likert-disagree);
}

.likert-dot--4:hover,
.likert-dot--5:hover,
.likert-dot--6:hover {
  background: rgba(167, 139, 250, 0.12);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.22);
}

.result-code {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  margin: 0 0 0.5rem;
  color: var(--accent);
}

.result-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 1rem;
}

.result-summary {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 1.25rem;
  text-align: center;
}

.axes {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.axis {
  font-size: 0.82rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface2);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.axis-title {
  margin: 0 0 0.4rem;
  text-align: center;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--axis-color, var(--accent));
}

.axis-bar {
  position: relative;
  height: 14px;
  width: 100%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--axis-color, var(--accent)) 86%, #ffffff 14%);
  margin-bottom: 0.4rem;
}

.axis-knob {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--axis-color, var(--accent));
  border: 3px solid #f4f4f5;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.axis-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.axis-labels span:last-child {
  text-align: right;
}

.traits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.trait {
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid var(--border);
  color: var(--text);
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hidden {
  display: none !important;
}

footer {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

@media (min-width: 600px) {
  .app {
    padding-top: 3rem;
  }

  header h1 {
    font-size: 2rem;
  }
}
