/* صمیمیت — plum velvet + champagne gold · discreet luxury */

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

:root {
  --plum-deep: #3b0a1f;
  --plum-wine: #7a1f3d;
  --gold: #c4a35a;
  --gold-soft: #dcc68a;
  --gold-muted: rgba(196, 163, 90, 0.55);
  --bg: #3b0a1f;
  --text: #f5eef2;
  --muted: rgba(245, 238, 242, 0.52);
  --accent: #7a1f3d;
  --accent-soft: #c4a35a;
  --accent-glow: rgba(196, 163, 90, 0.28);
  --card: rgba(255, 255, 255, 0.035);
  --card-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.07);
  --radius: 16px;
  --radius-lg: 22px;
  --font: 'Vazirmatn', system-ui, sans-serif;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

html { direction: rtl; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body[data-mode="landing"] {
  background: linear-gradient(168deg, #3b0a1f 0%, #2a0616 42%, #1f0512 100%);
}
body[data-mode="quiz"],
body[data-mode="analyzing"],
body[data-mode="results"] {
  background: linear-gradient(168deg, #3b0a1f, #2a0616);
}

/* Soft orbs — plum + gold */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  animation: orbFloat 24s ease-in-out infinite;
}

.orb-1 {
  width: 480px;
  height: 480px;
  background: #7a1f3d;
  top: -12%;
  right: -8%;
}

.orb-2 {
  width: 380px;
  height: 380px;
  background: #c4a35a;
  bottom: -8%;
  left: -6%;
  animation-delay: -9s;
  opacity: 0.16;
}

.orb-3 {
  width: 320px;
  height: 320px;
  background: #5c1530;
  top: 42%;
  left: 28%;
  animation-delay: -16s;
  opacity: 0.18;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(24px, -18px) scale(1.04); }
  66% { transform: translate(-16px, 22px) scale(0.97); }
}

body[data-mode="quiz"] .bg-orbs,
body[data-mode="analyzing"] .bg-orbs,
body[data-mode="results"] .bg-orbs {
  opacity: 0.45;
}

#app { position: relative; z-index: 1; min-height: 100dvh; }

.screen {
  display: none;
  min-height: 100dvh;
  animation: fadeIn 0.5s ease;
}

.screen.active { display: flex; flex-direction: column; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 30px;
  border-radius: 14px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, #7a1f3d, #5c1530);
  color: #faf6f0;
  box-shadow: 0 8px 28px rgba(122, 31, 61, 0.32);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(122, 31, 61, 0.42);
}

.btn-primary.btn-disabled,
.btn-primary:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-glow { animation: btnGlow 3.5s ease-in-out infinite; }

@keyframes btnGlow {
  0%, 100% { box-shadow: 0 8px 28px rgba(196, 163, 90, 0.22), 0 0 0 0 rgba(196, 163, 90, 0); }
  50% { box-shadow: 0 10px 40px rgba(196, 163, 90, 0.38), 0 0 24px rgba(196, 163, 90, 0.12); }
}

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  margin-top: 12px;
}

.btn-secondary:hover { background: var(--card-hover); }

.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.btn-icon:hover { background: var(--card-hover); }

/* Landing */
#screen-landing {
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 6vw, 48px) 24px;
}

.landing-content {
  text-align: center;
  max-width: 520px;
  width: 100%;
  z-index: 2;
}

.age-notice {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  margin-bottom: 36px;
  padding: 14px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(196, 163, 90, 0.14);
  text-align: right;
}

.age-badge {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  background: rgba(196, 163, 90, 0.1);
  color: var(--gold-soft);
  border: 1px solid rgba(196, 163, 90, 0.28);
}

.age-notice p {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 400;
}

.logo-diamond {
  width: 88px;
  height: 88px;
  margin: 0 auto 32px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(122, 31, 61, 0.18), rgba(196, 163, 90, 0.06));
  border: 1px solid rgba(196, 163, 90, 0.22);
  display: grid;
  place-items: center;
  color: var(--gold-soft);
  animation: diamondPulse 5s ease-in-out infinite;
}

.diamond-logo-svg { width: 48px; height: 48px; }

@keyframes diamondPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(196, 163, 90, 0.12); transform: scale(1); }
  50% { box-shadow: 0 0 40px rgba(196, 163, 90, 0.22); transform: scale(1.02); }
}

.landing-title {
  font-size: clamp(2.4rem, 8vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #fff 25%, #dcc68a 70%, #c4a35a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-sub {
  color: var(--gold-muted);
  margin-bottom: 20px;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.landing-desc {
  color: var(--muted);
  margin-bottom: 32px;
  font-size: 0.92rem;
  line-height: 1.85;
  max-width: 440px;
  margin-inline: auto;
}

.landing-stats {
  display: flex;
  justify-content: center;
  gap: 36px;
  margin-bottom: 36px;
}

.stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.stat-num {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.landing-note {
  margin-top: 20px;
  font-size: 0.76rem;
  color: rgba(245, 238, 242, 0.38);
}

/* Quiz */
.quiz-header {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(59, 10, 31, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.quiz-progress-wrap { flex: 1; min-width: 0; }

.linear-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.linear-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #5c1530, #7a1f3d, #c4a35a);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
}

.phase-label {
  font-weight: 600;
  color: var(--gold-muted);
}

.quiz-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 44px;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.question-card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  backdrop-filter: blur(8px);
  transition: opacity 0.28s, transform 0.28s;
}

.question-card.slide-out { opacity: 0; transform: translateX(-16px); }

.question-dim {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(196, 163, 90, 0.08);
  color: var(--gold-muted);
  border: 1px solid rgba(196, 163, 90, 0.12);
  margin-bottom: 16px;
}

.question-text {
  font-size: clamp(1.05rem, 3.5vw, 1.26rem);
  font-weight: 600;
  line-height: 1.85;
  margin-bottom: 14px;
}

.likert-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.likert-options { display: flex; flex-direction: column; gap: 10px; }

.likert-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px solid var(--border);
  border-right: 3px solid var(--opt-color, rgba(196, 163, 90, 0.35));
  border-radius: 14px;
  cursor: pointer;
  font-family: var(--font);
  color: var(--text);
  text-align: right;
  transition: var(--transition);
}

/* Override JS inline colors — calm plum/gold palette */
.likert-btn:nth-child(1) { --opt-color: #c4a35a !important; }
.likert-btn:nth-child(2) { --opt-color: #a8894a !important; }
.likert-btn:nth-child(3) { --opt-color: #8a6b5c !important; }
.likert-btn:nth-child(4) { --opt-color: #7a1f3d !important; }
.likert-btn:nth-child(5) { --opt-color: #5c4a52 !important; }

.likert-btn:hover {
  background: rgba(196, 163, 90, 0.05);
  border-color: rgba(196, 163, 90, 0.22);
}

.likert-btn.selected {
  background: rgba(122, 31, 61, 0.14);
  border-color: rgba(196, 163, 90, 0.38);
  border-right-color: var(--gold);
  box-shadow: 0 0 20px rgba(196, 163, 90, 0.08);
}

.likert-num {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.88rem;
  background: rgba(196, 163, 90, 0.1);
  color: var(--gold-soft);
  flex-shrink: 0;
  transition: var(--transition);
}

.likert-btn.selected .likert-num {
  background: linear-gradient(135deg, #c4a35a, #a8894a);
  color: #3b0a1f;
}

.likert-label { flex: 1; font-size: 0.88rem; line-height: 1.55; }

.keyboard-hint {
  text-align: center;
  margin-top: 18px;
  font-size: 0.7rem;
  color: rgba(245, 238, 242, 0.35);
}

.keyboard-hint kbd {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.68rem;
}

/* Analyzing */
#screen-analyzing { align-items: center; justify-content: center; }

.analyzing-content {
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 18px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
.results-container {
  max-width: 740px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 32px) clamp(18px, 4vw, 24px) 56px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.results-container.results-reveal {
  opacity: 1;
  transform: translateY(0);
}

.results-hero {
  text-align: center;
  padding: 36px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(122, 31, 61, 0.16), rgba(196, 163, 90, 0.06));
  border: 1px solid rgba(196, 163, 90, 0.16);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.results-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(196, 163, 90, 0.18) 0%, transparent 58%);
  opacity: 0.5;
  pointer-events: none;
}

.results-brand {
  font-size: 0.76rem;
  color: var(--gold-muted);
  margin-bottom: 12px;
  letter-spacing: 0.08em;
  position: relative;
}

.level-badge {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
  position: relative;
  background: rgba(196, 163, 90, 0.1);
  border: 1px solid rgba(196, 163, 90, 0.22);
  color: var(--gold-soft);
}

#level-title {
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 700;
  margin-bottom: 10px;
  position: relative;
  line-height: 1.45;
}

#level-summary {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.8;
  margin-bottom: 20px;
  position: relative;
  max-width: 480px;
  margin-inline: auto;
}

.spectrum-wrap {
  max-width: 380px;
  margin: 0 auto;
  position: relative;
}

.spectrum-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: rgba(245, 238, 242, 0.4);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.spectrum-track {
  position: relative;
  height: 6px;
  background: linear-gradient(90deg, #5c1530, #7a1f3d, #c4a35a);
  border-radius: 6px;
  opacity: 0.85;
}

.spectrum-fill {
  position: absolute;
  inset: 0;
  right: 0;
  left: auto;
  width: 100%;
  background: rgba(59, 10, 31, 0.55);
  border-radius: 6px;
  transition: width 1s ease;
}

.spectrum-marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background: var(--gold-soft);
  border: 2px solid #3b0a1f;
  border-radius: 50%;
  transform: translate(50%, -50%);
  transition: right 1s ease;
  box-shadow: 0 0 12px rgba(196, 163, 90, 0.35);
}

.score-detail-text {
  margin-top: 10px;
  font-size: 0.74rem;
  color: rgba(245, 238, 242, 0.42);
}

h3 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--gold-muted);
  letter-spacing: 0.02em;
}

.factors-section,
.diamond-section,
.bars-section { margin-bottom: 28px; }

.diamond-svg {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  display: block;
  opacity: 0.92;
}

.diamond-label {
  font-size: 8px;
  font-family: var(--font);
  font-weight: 600;
  fill: rgba(245, 238, 242, 0.65);
}

.diamond-data {
  animation: diamondReveal 1s ease forwards;
  transform-origin: center;
}

@keyframes diamondReveal {
  from { opacity: 0; transform: scale(0.88); }
  to { opacity: 1; transform: scale(1); }
}

.factor-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.factor-card {
  --fc: #7a1f3d;
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 8px;
  text-align: center;
}

.factor-card--strong { border-color: rgba(196, 163, 90, 0.28); }
.factor-card--focus { border-color: rgba(122, 31, 61, 0.35); }

.ftag {
  position: absolute;
  top: 5px;
  left: 5px;
  font-size: 0.52rem;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.ftag.strong {
  background: rgba(196, 163, 90, 0.12);
  color: var(--gold-soft);
}

.ftag.focus {
  background: rgba(122, 31, 61, 0.18);
  color: #e8b4c8;
}

.factor-icon {
  font-size: 1.15rem;
  display: block;
  margin-bottom: 6px;
  opacity: 0.9;
}

.factor-card h4 {
  font-size: 0.64rem;
  line-height: 1.4;
  margin-bottom: 10px;
  font-weight: 600;
}

.factor-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 6px;
}

.fdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.fdot.on { background: var(--fc, var(--gold)); }

.factor-lvl {
  font-size: 0.6rem;
  color: var(--muted);
}

.factor-bars { display: flex; flex-direction: column; gap: 14px; }

.factor-bar-row {
  --fc: #7a1f3d;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  border-right: 2px solid var(--fc);
}

.factor-bar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.factor-bar-icon { font-size: 1.05rem; }

.factor-bar-name {
  flex: 1;
  font-size: 0.86rem;
  font-weight: 600;
}

.factor-bar-lvl {
  font-size: 0.72rem;
  color: var(--gold-muted);
  font-weight: 600;
}

.factor-bar-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 10px;
}

.factor-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--fc), var(--gold));
  border-radius: 5px;
  transition: width 1s ease;
  opacity: 0.85;
}

.factor-bar-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.65;
}

.highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.hl-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.hl-block h4 {
  font-size: 0.86rem;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text);
}

.hl-block ul {
  list-style: none;
  font-size: 0.84rem;
  color: var(--muted);
}

.hl-block li { padding: 4px 0; }

.hl-block--grow { border-color: rgba(196, 163, 90, 0.2); }

.insight-text {
  font-size: 0.88rem;
  line-height: 1.85;
  color: var(--muted);
  padding: 18px;
  background: var(--card);
  border-radius: 14px;
  border-right: 2px solid rgba(196, 163, 90, 0.35);
  margin-bottom: 14px;
}

.sensitivity-text {
  font-size: 0.84rem;
  line-height: 1.85;
  color: var(--muted);
  padding: 18px;
  background: rgba(122, 31, 61, 0.08);
  border-radius: 14px;
  border: 1px solid rgba(122, 31, 61, 0.14);
  margin-bottom: 18px;
}

.action-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
  border-right: 2px solid rgba(196, 163, 90, 0.3);
}

.action-card h3 {
  font-size: 0.92rem;
  margin-bottom: 8px;
  color: var(--text);
}

.action-sub {
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.action-card ul {
  list-style: none;
  font-size: 0.83rem;
  color: var(--muted);
}

.action-card li {
  padding: 4px 0 4px 14px;
  position: relative;
}

.action-card li::before {
  content: '';
  position: absolute;
  right: 0;
  top: 11px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.7;
}

.results-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.disclaimer {
  text-align: center;
  font-size: 0.72rem;
  color: rgba(245, 238, 242, 0.38);
  line-height: 1.6;
}

.disclaimer-sub {
  text-align: center;
  font-size: 0.68rem;
  color: rgba(245, 238, 242, 0.28);
  margin-top: 8px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 4, 12, 0.82);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  background: linear-gradient(168deg, #4a1028, #3b0a1f);
  border: 1px solid rgba(196, 163, 90, 0.18);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.modal-age-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.72rem;
  background: rgba(196, 163, 90, 0.1);
  color: var(--gold-soft);
  border: 1px solid rgba(196, 163, 90, 0.25);
}

.modal-card h2 {
  margin-bottom: 18px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-card ul {
  list-style: none;
  margin-bottom: 18px;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.8;
}

.modal-card li {
  padding: 6px 14px 6px 0;
  position: relative;
}

.modal-card li::before {
  content: '·';
  position: absolute;
  right: 0;
  color: var(--gold);
  font-weight: 700;
}

.modal-card strong { color: var(--gold-soft); font-weight: 600; }

.age-ack-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.65;
  cursor: pointer;
}

.age-ack-label input {
  margin-top: 4px;
  accent-color: var(--gold);
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.modal-card .btn-primary { width: 100%; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(168deg, #4a1028, #3b0a1f);
  border: 1px solid rgba(196, 163, 90, 0.18);
  padding: 11px 22px;
  border-radius: 12px;
  font-size: 0.84rem;
  z-index: 200;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.toast.hidden { display: none; }

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 100;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: color .25s, background .25s, border-color .25s, transform .25s;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  background: var(--card-hover);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--accent-glow);
  outline-offset: 3px;
}

.theme-icon {
  position: absolute;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity .25s, transform .35s;
}

.theme-icon--moon { opacity: 0; transform: rotate(-30deg) scale(.65); }

[data-theme="light"] .theme-icon--sun { opacity: 0; transform: rotate(45deg) scale(.65); }
[data-theme="light"] .theme-icon--moon { opacity: 1; transform: rotate(0) scale(1); }

body[data-mode="quiz"] .quiz-header { padding-left: 72px; }

@media (min-width: 640px) {
  .likert-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
  }

  .likert-btn {
    flex-direction: column;
    text-align: center;
    min-height: 112px;
    padding: 16px 10px;
    border-right: 1.5px solid var(--border);
    border-top: 3px solid var(--opt-color, rgba(196, 163, 90, 0.35));
  }

  .likert-btn.selected {
    border-right-color: rgba(196, 163, 90, 0.38);
    border-top-color: var(--gold);
  }

  .results-actions {
    flex-direction: row;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .factor-cards { grid-template-columns: repeat(2, 1fr); }
  .highlights { grid-template-columns: 1fr; }
  .btn-primary, .btn-secondary { width: 100%; }
  .landing-stats { gap: 24px; }
  .age-notice {
    flex-direction: column;
    text-align: center;
    border-radius: var(--radius-lg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, .logo-diamond, .btn-glow, .orb { animation: none !important; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ===== LIGHT THEME — soft blush ivory + gold ===== */
[data-theme="light"] {
  --bg: #faf6f2;
  --text: #3b1528;
  --muted: rgba(59, 21, 40, 0.62);
  --accent: #7a1f3d;
  --accent-soft: #9a6b2e;
  --accent-glow: rgba(196, 163, 90, 0.22);
  --card: rgba(255, 255, 255, 0.78);
  --card-hover: rgba(255, 255, 255, 0.95);
  --border: rgba(122, 31, 61, 0.1);
  --chart-grid: rgba(122, 31, 61, 0.1);
}

[data-theme="light"] body {
  background: linear-gradient(168deg, #faf6f2 0%, #f5ebe4 52%, #f0e6dc 100%);
}

[data-theme="light"] body[data-mode="landing"] {
  background: linear-gradient(168deg, #faf6f2 0%, #f5ebe4 48%, #efe4da 100%);
}

[data-theme="light"] body[data-mode="quiz"],
[data-theme="light"] body[data-mode="analyzing"],
[data-theme="light"] body[data-mode="results"] {
  background: linear-gradient(168deg, #faf6f2, #f5ebe4);
}

[data-theme="light"] .orb {
  filter: blur(120px);
  opacity: 0.1;
}

[data-theme="light"] .orb-1 { background: #c4a35a; opacity: 0.08; }
[data-theme="light"] .orb-2 { background: #7a1f3d; opacity: 0.06; }

[data-theme="light"] .landing-title {
  background: linear-gradient(135deg, #3b1528 15%, #7a1f3d 55%, #9a6b2e 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .landing-sub,
[data-theme="light"] .stat-num,
[data-theme="light"] .phase-label,
[data-theme="light"] h3,
[data-theme="light"] .results-brand {
  color: #9a6b2e;
}

[data-theme="light"] .logo-diamond {
  color: #9a6b2e;
  background: linear-gradient(145deg, rgba(122, 31, 61, 0.08), rgba(196, 163, 90, 0.1));
  border-color: rgba(196, 163, 90, 0.28);
}

[data-theme="light"] .age-notice {
  background: rgba(196, 163, 90, 0.06);
  border-color: rgba(196, 163, 90, 0.18);
}

[data-theme="light"] .age-badge {
  color: #8a5c28;
  background: rgba(196, 163, 90, 0.12);
}

[data-theme="light"] .theme-toggle {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 28px rgba(122, 31, 61, 0.08);
}

[data-theme="light"] .quiz-header {
  background: rgba(250, 246, 242, 0.92);
  box-shadow: 0 1px 0 rgba(122, 31, 61, 0.04);
}

[data-theme="light"] .question-dim {
  background: rgba(196, 163, 90, 0.1);
  color: #8a5c28;
  border-color: rgba(196, 163, 90, 0.16);
}

[data-theme="light"] .question-card,
[data-theme="light"] .results-hero,
[data-theme="light"] .factor-card,
[data-theme="light"] .factor-bar-row,
[data-theme="light"] .hl-block,
[data-theme="light"] .insight-text,
[data-theme="light"] .sensitivity-text,
[data-theme="light"] .action-card {
  box-shadow: 0 10px 32px rgba(122, 31, 61, 0.05);
}

[data-theme="light"] .likert-btn {
  background: rgba(255, 255, 255, 0.65);
}

[data-theme="light"] .likert-btn.selected {
  background: rgba(122, 31, 61, 0.06);
  box-shadow: 0 4px 16px rgba(196, 163, 90, 0.1);
}

[data-theme="light"] .likert-btn.selected .likert-num {
  color: #faf6f2;
}

[data-theme="light"] .fdot { background: rgba(122, 31, 61, 0.12); }

[data-theme="light"] .spectrum-fill { background: rgba(250, 246, 242, 0.6); }

[data-theme="light"] .spectrum-marker {
  border-color: #faf6f2;
  background: #c4a35a;
}

[data-theme="light"] .results-hero {
  background: linear-gradient(145deg, rgba(122, 31, 61, 0.06), rgba(196, 163, 90, 0.08));
  border-color: rgba(196, 163, 90, 0.2);
}

[data-theme="light"] .ftag.strong { color: #8a5c28; }
[data-theme="light"] .ftag.focus { color: #7a1f3d; }

[data-theme="light"] .modal-backdrop { background: rgba(59, 21, 40, 0.38); }

[data-theme="light"] .modal-card,
[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  border-color: rgba(196, 163, 90, 0.16);
  box-shadow: 0 24px 60px rgba(59, 21, 40, 0.12);
}

[data-theme="light"] .modal-age-badge {
  color: #8a5c28;
  background: rgba(196, 163, 90, 0.1);
}

[data-theme="light"] .disclaimer { color: rgba(59, 21, 40, 0.48); }
[data-theme="light"] .disclaimer-sub { color: rgba(59, 21, 40, 0.36); }
[data-theme="light"] .landing-note { color: rgba(59, 21, 40, 0.38); }
[data-theme="light"] .keyboard-hint { color: rgba(59, 21, 40, 0.35); }
