/*
  Why Are You Like This? — visual system
  Concept: every one of the 16 types gets its own signature color ("true
  color"). The app itself is warm, rounded, and playful — friendly enough
  for a party quiz, still substantial enough for a full personality report.
*/

:root {
  --ink: #2D2A3A;
  --ink-soft: #726C82;
  --bg: #FFF8F0;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --surface-tint: #F6F1FF;
  --border: #ECE3F5;
  --border-soft: #F3EEFA;

  --accent: #7C5CFC;
  --accent-deep: #6142E0;
  --accent-soft: #EFE9FF;
  --sun: #FFB020;
  --sun-soft: #FFF3DC;
  --good: #22B573;
  --good-soft: #DDF6EA;
  --warn: #FF7A59;
  --warn-soft: #FFE7DF;

  --shadow: 0 10px 26px rgba(124, 92, 252, 0.14);
  --shadow-sm: 0 4px 12px rgba(45, 42, 58, 0.08);
  --radius: 22px;
  --radius-sm: 14px;
  color-scheme: light;

  --font-display: 'Fredoka', 'Baloo 2', system-ui, sans-serif;
  --font-body: 'Poppins', -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Overridden per-type on the results screen (falls back to --accent) */
  --type-color: var(--accent);
  --type-color-soft: var(--accent-soft);
}

/* Fixed light appearance by design — no dark mode variant. */

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  position: relative;
  overflow-x: hidden;
}

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.brand-mark { flex-shrink: 0; object-fit: contain; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand-sub { color: var(--ink-soft); font-size: 0.82rem; }

/* ---------- Top nav ---------- */
.topnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  color: var(--ink-soft);
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.nav-btn svg { width: 16px; height: 16px; }
.nav-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
.nav-btn.active svg * { fill: white !important; stroke: white !important; }
.nav-btn:hover:not(.active) { border-color: var(--accent); color: var(--accent-deep); }

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}
@media (max-width: 480px) {
  .card { padding: 22px; border-radius: 18px; }
}

.confetti-row { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.confetti-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.confetti-dot:nth-child(2) { width: 14px; height: 14px; margin-top: 6px; }
.confetti-dot:nth-child(4) { width: 8px; height: 8px; margin-top: -4px; }
.confetti-dot:nth-child(6) { width: 12px; height: 12px; margin-top: 3px; }

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--ink);
}
h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; margin: 0 0 10px; color: var(--ink); }
h3 { font-size: 0.95rem; margin: 0 0 6px; font-weight: 800; }
p { margin: 0 0 12px; color: var(--ink); max-width: 62ch; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.85rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow .15s ease;
  font-family: var(--font-display);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: white; box-shadow: 0 8px 20px rgba(124,92,252,0.35); }
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(124,92,252,0.42); }
.btn-primary:active { transform: scale(0.97) translateY(0); }
.btn-ghost { background: var(--surface-tint); color: var(--ink); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--accent-soft); border-color: var(--accent); transform: translateY(-1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.btn:focus-visible, .tab-btn:focus-visible, .select:focus-visible, .likert-opt input:focus-visible + .likert-dot, .segmented button:focus-visible, .nav-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.select, .text-input {
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.98rem;
  font-family: var(--font-body);
  width: 100%;
}
.select:focus, .text-input:focus { outline: none; border-color: var(--accent); }
.field-hint { font-size: 0.76rem; color: var(--ink-soft); margin-top: 4px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 160px; }

/* ---------- Compass mark (brand + landing illustration) ---------- */
.rose-wrap { display: flex; flex-direction: column; align-items: center; margin: 4px 0 22px; }
.rose-caption { font-size: 0.78rem; color: var(--ink-soft); font-weight: 700; margin-top: 8px; }
.rose-svg text { font-family: var(--font-display); font-weight: 600; }

/* ---------- Landing ---------- */
.landing-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.landing-divider { display: flex; align-items: center; gap: 10px; margin: 22px 0 14px; color: var(--ink-soft); font-size: 0.85rem; font-weight: 700; }
.landing-divider::before, .landing-divider::after { content: ""; flex: 1; height: 2px; background: var(--border); border-radius: 2px; }
.disclaimer { font-size: 0.78rem; color: var(--ink-soft); margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); }

/* ---------- Quiz ---------- */
.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
  margin-bottom: 22px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.progress-label { font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 6px; display: flex; justify-content: space-between; font-weight: 700; }

.question-block { margin-bottom: 30px; }
.question-text { font-size: 1.05rem; font-weight: 700; margin-bottom: 14px; max-width: none; }
.likert {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  padding: 4px 0;
}
@media (max-width: 480px) {
  .likert { gap: 14px; }
}
.likert-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  z-index: 1;
  padding: 6px;
}
.likert-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface-raised);
  transition: all 0.12s ease;
}
@media (max-width: 480px) {
  .likert-dot { width: 26px; height: 26px; }
}
.likert-opt:hover .likert-dot { border-color: var(--accent); }
.likert-opt input { position: absolute; opacity: 0; pointer-events: none; }
.likert-opt input:checked + .likert-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.likert-caps { display: flex; justify-content: space-between; font-size: 0.74rem; color: var(--ink-soft); margin-top: 8px; font-weight: 700; }

/* ---------- Result sheet ---------- */
.sheet {
  background: var(--type-color-soft);
  border: 1.5px solid var(--type-color);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.sheet-title { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--type-color); margin-bottom: 4px; }
.sheet-name { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; }
.sheet-meta { font-size: 0.84rem; color: var(--ink-soft); margin-top: 2px; }
.sheet-badge {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--type-color);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  flex-shrink: 0;
}

/* ---------- Results ---------- */
.result-header { text-align: center; margin-bottom: 8px; }
.result-code {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--type-color);
}
.result-nickname { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; margin-top: 4px; }
.result-tagline { color: var(--ink-soft); margin: 4px auto 0; }
.result-group-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--type-color-soft); color: var(--type-color);
  font-size: 0.76rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 5px 12px; border-radius: 999px; margin-top: 8px;
}
.result-group-chip svg { width: 13px; height: 13px; }

.dichotomy-bars { display: flex; flex-direction: column; gap: 14px; margin: 22px 0; }
.dichotomy-labels { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 5px; font-weight: 700; color: var(--ink-soft); }
.dichotomy-labels .win { color: var(--type-color); }
.dichotomy-track { height: 10px; border-radius: 999px; background: var(--border-soft); overflow: hidden; display: flex; }
.dichotomy-fill { height: 100%; background: var(--type-color); }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 22px 0 18px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 16px;
}
.tab-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-tint);
  border: 1.5px solid transparent;
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
}
.tab-btn svg { width: 14px; height: 14px; }
.tab-btn.active { background: var(--type-color); color: white; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.trait-list { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; padding: 0; list-style: none; }
.trait-card {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface-tint);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.trait-card .trait-icon {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.trait-card.trait-good .trait-icon { background: var(--good-soft); color: var(--good); }
.trait-card.trait-watch .trait-icon { background: var(--warn-soft); color: var(--warn); }
.trait-card .trait-icon svg { width: 15px; height: 15px; }
.trait-card p { margin: 0; font-size: 0.92rem; }
.trait-lead { font-weight: 800; }
.trait-example { color: var(--ink-soft); }

.func-item { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.func-item:last-child { border-bottom: none; }
.func-item h3 { color: var(--type-color); font-size: 0.88rem; }

.sub-card {
  background: var(--surface-tint);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.sub-card h3 { margin-bottom: 6px; color: var(--type-color); display: flex; align-items: center; gap: 6px; }
.sub-card h3 svg { width: 15px; height: 15px; }

.unf-italic { font-style: italic; color: var(--ink-soft); }
.unf-future-card { background: var(--type-color-soft); }
.contradiction-row { margin-bottom: 14px; }
.contradiction-row:last-child { margin-bottom: 0; }
.contradiction-line { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.contradiction-tag { flex-shrink: 0; font-family: var(--font-display); font-size: 0.63rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.tag-seems { background: var(--surface-raised); color: var(--ink-soft); border: 1px solid var(--border); }
.tag-actually { background: var(--type-color-soft); color: var(--type-color); }
.contradiction-line p { margin: 0; font-size: 0.9rem; }
.contradiction-line.line-actually p { font-weight: 700; }

.split-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.split-row .sub-card { flex: 1; min-width: 220px; margin-bottom: 0; }
.sub-card-good { background: var(--good-soft); }
.sub-card-good h3 { color: var(--good); }
.sub-card-warn { background: var(--warn-soft); }
.sub-card-warn h3 { color: var(--warn); }

.trait-card.trait-tip .trait-icon { background: var(--type-color-soft); color: var(--type-color); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  background: var(--type-color-soft);
  color: var(--type-color);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}

/* ---------- Compatibility ---------- */
.compat-controls { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.compat-person { display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 180px; }
.compat-field { flex: 1; min-width: 160px; }
.compat-field label { font-size: 0.78rem; color: var(--ink-soft); display: block; margin-bottom: 4px; font-weight: 700; }
.segmented { display: flex; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button {
  flex: 1; background: var(--surface-raised); border: none; color: var(--ink-soft);
  padding: 10px; font-size: 0.85rem; font-weight: 700; cursor: pointer; font-family: var(--font-body);
}
.segmented button.active { background: var(--accent); color: white; }

.compat-result { margin-top: 12px; }
.compat-score-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.compat-score-badge {
  position: relative;
  width: 68px; height: 68px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.compat-score-badge svg { position: absolute; inset: 0; }
.compat-score-num {
  position: relative;
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.1rem;
}
.compat-score-label { font-weight: 700; font-family: var(--font-display); font-size: 1.1rem; }
.compat-score-sub { font-size: 0.8rem; color: var(--ink-soft); font-weight: 700; }
.compat-intro { margin-bottom: 16px; }
.axis-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.axis-row { border-left: 4px solid var(--border); padding: 4px 0 4px 12px; border-radius: 0 8px 8px 0; }
.axis-row.axis-shared { border-left-color: var(--good); background: var(--good-soft); }
.axis-row.axis-diff { border-left-color: var(--warn); background: var(--warn-soft); }
.axis-row-head { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 3px; }
.axis-name { font-weight: 800; }
.axis-poles { color: var(--ink-soft); font-variant-numeric: tabular-nums; font-weight: 700; }
.axis-row p { margin: 0; padding: 6px 0 8px; font-size: 0.9rem; color: var(--ink-soft); max-width: none; }
.compat-closing { font-size: 0.92rem; }
.compat-disclaimer { font-size: 0.76rem; color: var(--ink-soft); margin-top: 10px; }

.gender-notes { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.gender-notes-heading { font-size: 0.76rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin-bottom: 8px; }
.gender-note { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.gender-note-tag { flex-shrink: 0; background: var(--accent-soft); color: var(--accent-deep); font-family: var(--font-display); font-weight: 600; font-size: 0.72rem; padding: 3px 8px; border-radius: 999px; margin-top: 1px; }
.gender-note p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }

.top-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 10px; flex-wrap: wrap; }

/* ---------- Types browse grid ---------- */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.type-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  background: var(--card-bg, var(--surface-tint));
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  transition: transform .12s ease, box-shadow .12s ease;
}
.type-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.type-card .type-card-icon {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
}
.type-card .type-card-icon svg { width: 18px; height: 18px; }
.type-card .type-card-code { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.type-card .type-card-name { font-size: 0.82rem; color: var(--ink-soft); font-weight: 700; }

.group-legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.group-legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--ink-soft); font-weight: 700; }
.group-legend-item .dot { width: 10px; height: 10px; border-radius: 50%; }

/* ---------- About ---------- */
.about-block { margin-bottom: 18px; }
.about-block h3 { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 1rem; }
.about-block h3 svg { width: 17px; height: 17px; }

footer.note { text-align: center; margin-top: 20px; color: var(--ink-soft); font-size: 0.78rem; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

[hidden] { display: none !important; }
