/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0F0F0F;
  --surface: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.1);
  --text: #F9FAFB;
  --muted: rgba(255, 255, 255, 0.45);
  --saver: #10B981;
  --spender: #EC4899;
  --investor: #3B82F6;
  --dreamer: #8B5CF6;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Ambient background glow */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 15%, rgba(16, 185, 129, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 85%, rgba(139, 92, 246, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.04) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.khmer {
  font-family: 'Hanuman', 'Inter', sans-serif;
}

/* ===== NAV ===== */
.nav {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.nav-logo {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-link {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--text);
}

/* ===== MAIN ===== */
.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

/* ===== SCREENS ===== */
.screen {
  display: none;
  width: 100%;
  max-width: 580px;
}

.screen.active {
  display: block;
  animation: fadeUp 0.4s ease both;
}

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

/* ===== CARD (glassmorphism) ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}

/* ===== START SCREEN ===== */
.start-card {
  text-align: center;
  padding: 3rem 2.5rem;
}

.start-emoji {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 1.25rem;
  display: block;
  animation: float 3s ease-in-out infinite;
}

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

.start-title {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 0.875rem;
}

.highlight {
  background: linear-gradient(135deg, #10B981 0%, #3B82F6 50%, #8B5CF6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.start-subtitle {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 0.5rem;
}

.start-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.9rem 2rem;
  border: none;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #10B981, #3B82F6);
  color: #fff;
  box-shadow: 0 4px 22px rgba(16, 185, 129, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.38);
}

.btn-share {
  background: linear-gradient(135deg, #EC4899, #8B5CF6);
  color: #fff;
  box-shadow: 0 4px 22px rgba(236, 72, 153, 0.28);
}

.btn-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(236, 72, 153, 0.38);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border: 1px solid var(--border);
  margin-top: 0.625rem;
  font-size: 0.9rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  margin-top: 0.625rem;
  font-size: 0.9rem;
  text-decoration: none;
}

.btn-ghost:hover {
  background: transparent;
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.25);
}

/* ===== PROGRESS ===== */
.progress-container {
  margin-bottom: 1.25rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #3B82F6, #8B5CF6);
  border-radius: 999px;
  width: 0%;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== QUESTION CARD ===== */
.question-card.exit {
  animation: slideOut 0.22s ease forwards;
}

.question-card.enter {
  animation: slideIn 0.32s ease both;
}

@keyframes slideOut {
  to { opacity: 0; transform: translateX(-28px); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}

.question-number {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.question-text {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.55;
  margin-bottom: 0.4rem;
}

.question-sub {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 1.5rem;
}

/* ===== ANSWERS ===== */
.answers {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.answer-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  color: var(--text);
  font-family: 'Hanuman', 'Inter', sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
  width: 100%;
}

.answer-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateX(4px);
}

.answer-btn.picked {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}

.answer-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 2px;
}

.answer-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

/* ===== RESULT CARD ===== */
.result-card {
  text-align: center;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.result-emoji {
  font-size: 5rem;
  line-height: 1;
  margin-bottom: 0.75rem;
  display: block;
  animation: pop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

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

.result-badge {
  display: inline-block;
  padding: 0.28rem 1rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  margin-bottom: 1rem;
}

.result-title-km {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 0.25rem;
}

.result-title-en {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.result-desc-km {
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.82);
}

.result-desc-en {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 1.5rem;
}

/* ===== TRAITS GRID ===== */
.traits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  text-align: left;
}

.trait {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  font-size: 0.77rem;
  line-height: 1.45;
  font-family: 'Hanuman', 'Inter', sans-serif;
  color: rgba(255, 255, 255, 0.75);
}

.trait-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ===== RESULT ACTIONS ===== */
.result-actions {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.25rem;
}

.share-feedback {
  display: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: #10B981;
  padding: 0.5rem 0.25rem;
  text-align: center;
}

.share-feedback.show {
  display: block;
  animation: fadeUp 0.3s ease both;
}

/* ===== CALCULATOR LINK ===== */
.calculator-link {
  display: block;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  line-height: 1.5;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.calculator-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
}

/* ===== PERSONALITY COLOR CLASSES ===== */
/* Badge & text accent */
.color-saver   { color: var(--saver); }
.color-spender { color: var(--spender); }
.color-investor{ color: var(--investor); }
.color-dreamer { color: var(--dreamer); }

/* Result card glow */
.result-card.glow-saver {
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: 0 8px 40px rgba(0,0,0,0.35), 0 0 70px rgba(16, 185, 129, 0.1);
}
.result-card.glow-spender {
  border-color: rgba(236, 72, 153, 0.25);
  box-shadow: 0 8px 40px rgba(0,0,0,0.35), 0 0 70px rgba(236, 72, 153, 0.1);
}
.result-card.glow-investor {
  border-color: rgba(59, 130, 246, 0.25);
  box-shadow: 0 8px 40px rgba(0,0,0,0.35), 0 0 70px rgba(59, 130, 246, 0.1);
}
.result-card.glow-dreamer {
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 8px 40px rgba(0,0,0,0.35), 0 0 70px rgba(139, 92, 246, 0.1);
}

/* ===== MOBILE ===== */
@media (max-width: 480px) {
  .card {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .start-card {
    padding: 2.25rem 1.5rem;
  }

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

  .start-emoji {
    font-size: 3.25rem;
  }

  .question-text {
    font-size: 1.08rem;
  }

  .result-emoji {
    font-size: 4rem;
  }

  .result-title-km {
    font-size: 1.15rem;
  }

  .traits {
    grid-template-columns: 1fr;
  }

  .answer-btn {
    font-size: 0.83rem;
  }
}
