/* ========================================
   Villain Origin Test - Styles
   Primary: #1B0A2E (Deep Villain Purple)
   Dark mode first, Glassmorphism 2.0
   Binary tap card mechanic
   ======================================== */

/* ===== CSS Variables (Dark mode default) ===== */
:root {
  --primary: #1B0A2E;
  --primary-light: #3D1A6E;
  --primary-bright: #6B21A8;
  --primary-dark: #0D0518;
  --primary-glow: rgba(107, 33, 168, 0.3);
  --primary-glow-strong: rgba(107, 33, 168, 0.5);
  --primary-dim: rgba(107, 33, 168, 0.15);
  --bg: #080510;
  --bg2: #0D0A18;
  --surface: #151025;
  --surface2: #1E1635;
  --surface-hover: #2A1F45;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: rgba(255, 255, 255, 0.08);
  --border2: rgba(255, 255, 255, 0.12);
  --border-active: rgba(107, 33, 168, 0.5);
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 20px;
  --shadow: rgba(0, 0, 0, 0.5);
  --accent-red: #dc2626;
  --accent-purple: #7c3aed;
  --accent-blue: #1e40af;
  --accent-gold: #92400e;
  --accent-grey: #374151;
  --accent-crimson: #991b1b;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 6px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;

  /* Archetype colors */
  --betrayed: #1a237e;
  --mastermind: #4a148c;
  --anarchist: #b71c1c;
  --fallen-hero: #5d4037;
  --phantom: #263238;
  --conqueror: #880e4f;
}

/* ===== Light Mode ===== */
[data-theme="light"] {
  --bg: #f5f0fa;
  --bg2: #ede5f5;
  --surface: rgba(255, 255, 255, 0.85);
  --surface2: rgba(255, 255, 255, 0.92);
  --surface-hover: rgba(107, 33, 168, 0.06);
  --text: #1a1025;
  --text-muted: #4a3a5e;
  --text-dim: #7a6a90;
  --border: rgba(0, 0, 0, 0.08);
  --border2: rgba(0, 0, 0, 0.12);
  --border-active: rgba(107, 33, 168, 0.4);
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.8);
  --shadow: rgba(107, 33, 168, 0.08);
  --primary-glow: rgba(107, 33, 168, 0.12);
  --primary-glow-strong: rgba(107, 33, 168, 0.2);
  --primary-dim: rgba(107, 33, 168, 0.06);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', 'Noto Sans JP', 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

/* Background ambient glow - villain purple */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(107, 33, 168, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(136, 14, 79, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(26, 35, 126, 0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(107, 33, 168, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(136, 14, 79, 0.04) 0%, transparent 50%);
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Skip Link (a11y) ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--primary-bright);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  z-index: 10001;
  text-decoration: none;
  font-weight: 600;
  transition: top var(--transition);
}

.skip-link:focus {
  top: 16px;
}

/* ===== App Loader ===== */
#app-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.4s ease;
}

#app-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-icon {
  font-size: 3rem;
  animation: loaderPulse 1.2s ease-in-out infinite;
}

@keyframes loaderPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
}

/* ===== Theme Toggle ===== */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: all var(--transition);
  font-size: 1.1rem;
}

.theme-toggle:hover {
  background: var(--surface-hover);
  transform: scale(1.08);
  border-color: var(--primary-glow);
}

.theme-icon {
  line-height: 1;
}

/* ===== Language Selector ===== */
.lang-selector {
  position: fixed;
  top: 16px;
  right: 70px;
  z-index: 100;
}

.lang-btn {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-btn:hover {
  border-color: var(--primary-bright);
  background: var(--surface-hover);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px var(--shadow);
  padding: 6px;
  min-width: 160px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 101;
}

.lang-dropdown.active {
  display: block;
  animation: fadeSlideDown 0.2s ease;
}

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.lang-option {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}

.lang-option:hover {
  background: var(--primary-dim);
}

/* ===== Layout ===== */
main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 80px 16px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

.app-title {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, #9333ea, #6b21a8, #dc2626);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.app-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 6px;
}

.container {
  width: 100%;
  max-width: 600px;
}

/* ===== Glassmorphism Card ===== */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: 0 8px 32px var(--shadow);
  transition: all var(--transition);
}

/* ===== Start Screen ===== */
.start-content {
  text-align: center;
}

/* Villain Orb */
.villain-orb {
  width: 140px;
  height: 140px;
  margin: 0 auto 28px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #1B0A2E,
    #6b21a8,
    #dc2626,
    #880e4f,
    #4a148c,
    #1a237e,
    #1B0A2E
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: orbRotate 6s linear infinite;
  box-shadow:
    0 0 30px rgba(107, 33, 168, 0.3),
    0 0 60px rgba(136, 14, 79, 0.2),
    inset 0 0 30px rgba(27, 10, 46, 0.3);
}

.villain-orb::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(
    from 180deg,
    transparent 0%,
    rgba(220, 38, 38, 0.4) 25%,
    transparent 50%,
    rgba(107, 33, 168, 0.4) 75%,
    transparent 100%
  );
  animation: orbRotate 4s linear infinite reverse;
  filter: blur(8px);
}

.villain-orb::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--bg);
}

.orb-inner {
  position: relative;
  z-index: 2;
  font-size: 3rem;
  animation: orbPulse 2.5s ease-in-out infinite;
}

@keyframes orbRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(107, 33, 168, 0.4)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 24px rgba(220, 38, 38, 0.5)); }
}

.start-desc {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.btn-start {
  width: 100%;
  max-width: 280px;
  background: linear-gradient(135deg, #6b21a8, #dc2626);
  color: #fff;
  box-shadow: 0 4px 20px rgba(107, 33, 168, 0.4);
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.btn-start::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-start:hover::before {
  left: 100%;
}

.btn-start:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(220, 38, 38, 0.4);
}

.btn-start:active {
  transform: translateY(-1px);
}

/* ===== Progress Bar ===== */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6b21a8, #dc2626, #880e4f);
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 100%;
  background: rgba(255, 255, 255, 0.4);
  filter: blur(4px);
  animation: progressShine 1.5s ease-in-out infinite;
}

@keyframes progressShine {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* Quiz header with progress and combo */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 4px;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.combo-counter {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-red);
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.combo-counter.active {
  opacity: 1;
  transform: scale(1);
}

.combo-counter.bump {
  animation: comboBump 0.3s ease;
}

@keyframes comboBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ===== Binary Choice Cards ===== */
.binary-cards {
  display: flex;
  gap: 12px;
  align-items: stretch;
  min-height: 220px;
  perspective: 800px;
}

.choice-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  min-height: 180px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.choice-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.choice-left::before {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(107, 33, 168, 0.1));
}

.choice-right::before {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(107, 33, 168, 0.1));
}

.choice-card:hover::before {
  opacity: 1;
}

.choice-card:hover {
  border-color: var(--border-active);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 40px rgba(107, 33, 168, 0.2);
}

.choice-card:active {
  transform: translateY(-2px) scale(0.98);
}

.choice-emoji {
  font-size: 3rem;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.choice-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.3;
}

/* VS Divider */
.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
}

.vs-text {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Card transition animations */
.binary-cards.whoosh-left .choice-left {
  animation: whooshChosen 0.35s ease forwards;
}
.binary-cards.whoosh-left .choice-right {
  animation: whooshNotChosen 0.35s ease forwards;
}
.binary-cards.whoosh-right .choice-right {
  animation: whooshChosen 0.35s ease forwards;
}
.binary-cards.whoosh-right .choice-left {
  animation: whooshNotChosen 0.35s ease forwards;
}

@keyframes whooshChosen {
  0% { transform: scale(1); opacity: 1; }
  30% { transform: scale(1.08); opacity: 1; border-color: var(--primary-bright); box-shadow: 0 0 30px var(--primary-glow-strong); }
  100% { transform: scale(0.9) translateY(-20px); opacity: 0; }
}

@keyframes whooshNotChosen {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0; }
}

.binary-cards.slide-in .choice-card {
  animation: cardSlideIn 0.35s ease forwards;
}

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Result Screen ===== */
.result-card {
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: resultFadeIn 0.6s ease;
}

@keyframes resultFadeIn {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Dark particles for villain vibe */
.result-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(220, 38, 38, 0.4), transparent),
    radial-gradient(2px 2px at 40% 70%, rgba(107, 33, 168, 0.3), transparent),
    radial-gradient(1.5px 1.5px at 60% 20%, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(2px 2px at 80% 50%, rgba(136, 14, 79, 0.3), transparent),
    radial-gradient(1px 1px at 10% 80%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1.5px 1.5px at 70% 90%, rgba(26, 35, 126, 0.3), transparent);
  animation: sparkleFloat 8s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes sparkleFloat {
  from { transform: translateY(0) rotate(0deg); }
  to { transform: translateY(-20px) rotate(3deg); }
}

.result-card > * {
  position: relative;
  z-index: 1;
}

/* Archetype Icon */
.result-archetype-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: iconReveal 0.8s ease;
}

@keyframes iconReveal {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.result-archetype-name {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.result-narrative {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 28px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  font-style: italic;
}

/* ===== Trait Breakdown Bars ===== */
.trait-breakdown {
  margin: 24px 0;
  text-align: left;
}

.trait-breakdown h3 {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.trait-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trait-bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trait-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.trait-bar-label span:last-child {
  font-weight: 700;
  color: var(--text);
}

.trait-bar-track {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.trait-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0;
}

/* ===== Share Section ===== */
.share-section {
  margin: 28px 0 20px;
}

.share-section h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.share-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-share {
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-twitter {
  background: #1d9bf0;
  color: #fff;
  border: none;
}

.btn-twitter:hover {
  background: #1a8cd8;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(29, 155, 240, 0.3);
}

.btn-copy {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border2);
}

.btn-copy:hover {
  border-color: var(--primary-bright);
  background: var(--primary-dim);
  transform: translateY(-2px);
}

/* ===== Retake Button ===== */
.btn-retake {
  width: 100%;
  max-width: 280px;
  margin-top: 8px;
  background: transparent;
  color: var(--primary-bright);
  border: 2px solid var(--primary-bright);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  padding: 14px 32px;
}

.btn-retake:hover {
  background: var(--primary-dim);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-retake:active {
  transform: translateY(0);
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 30px 16px 40px;
  position: relative;
  z-index: 1;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: inline-block;
}

footer a:hover {
  color: var(--primary-bright);
  background: var(--primary-dim);
}

/* ===== Floating text animation ===== */
.floating-text {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--primary-bright);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  animation: floatUp 0.8s ease-out forwards;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  50% { opacity: 1; transform: translateY(-30px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-60px) scale(0.8); }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  main {
    padding: 70px 12px 32px;
  }

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

  .card {
    padding: 24px 16px;
  }

  .villain-orb {
    width: 110px;
    height: 110px;
  }

  .orb-inner {
    font-size: 2.4rem;
  }

  .binary-cards {
    min-height: 180px;
    gap: 8px;
  }

  .choice-card {
    padding: 20px 12px;
    min-height: 160px;
  }

  .choice-emoji {
    font-size: 2.4rem;
  }

  .choice-text {
    font-size: 0.9rem;
  }

  .vs-divider {
    width: 28px;
  }

  .vs-text {
    font-size: 0.6rem;
  }

  .result-archetype-icon {
    font-size: 3.2rem;
  }

  .result-archetype-name {
    font-size: 1.4rem;
  }

  .share-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn-share {
    width: 100%;
    max-width: 240px;
  }

  .lang-selector {
    right: 62px;
  }

  .lang-btn {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  #currentLang {
    display: none;
  }
}

@media (max-width: 360px) {
  .app-title {
    font-size: 1.3rem;
  }

  .villain-orb {
    width: 90px;
    height: 90px;
  }

  .orb-inner {
    font-size: 2rem;
  }

  .choice-emoji {
    font-size: 2rem;
  }

  .choice-card {
    min-height: 140px;
    padding: 16px 10px;
    gap: 12px;
  }
}

/* ===== Desktop enhancements ===== */
@media (min-width: 768px) {
  main {
    padding-top: 100px;
  }

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

  .app-subtitle {
    font-size: 1.15rem;
  }

  .card {
    padding: 40px 36px;
  }

  .villain-orb {
    width: 160px;
    height: 160px;
  }

  .orb-inner {
    font-size: 3.5rem;
  }

  .binary-cards {
    min-height: 260px;
    gap: 16px;
  }

  .choice-card {
    padding: 36px 24px;
    min-height: 220px;
  }

  .choice-emoji {
    font-size: 3.5rem;
  }

  .choice-text {
    font-size: 1.1rem;
  }

  .vs-divider {
    width: 44px;
  }

  .vs-text {
    font-size: 0.75rem;
  }
}

/* ===== Percentile Stat ===== */
.percentile-stat {
  margin: 20px 0 8px;
  padding: 12px 16px;
  background: var(--primary-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  text-align: center;
}

.percentile-stat strong {
  color: var(--primary-bright);
  font-weight: 800;
}

/* ===== Related Tests ===== */
.related-tests {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  width: 100%;
}

.related-tests h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.related-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.related-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--card-color, var(--primary-bright));
}

.related-card:hover {
  transform: translateY(-2px);
  border-color: var(--card-color, var(--primary-bright));
  box-shadow: 0 4px 16px var(--shadow);
}

.related-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.related-name {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

/* ===== Toast notification ===== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--surface2);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 16px var(--shadow);
  border: 1px solid var(--border2);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== ENGAGEMENT: Result Carousel ===== */
.result-carousel {
    position: relative; overflow: hidden; height: 52px; margin: 16px auto;
    max-width: 340px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
}
.carousel-track { display: flex; flex-direction: column; animation: carouselScroll 12s ease-in-out infinite; }
.carousel-item {
    height: 52px; display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600; color: var(--text); padding: 0 16px;
}
@keyframes carouselScroll {
    0%, 20% { transform: translateY(0); } 25%, 45% { transform: translateY(-52px); }
    50%, 70% { transform: translateY(-104px); } 75%, 95% { transform: translateY(-156px); }
    100% { transform: translateY(0); }
}
.social-proof-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(61, 26, 110, 0.2); border: 1px solid rgba(61, 26, 110, 0.35);
    color: var(--accent, #a855f7); padding: 6px 16px; border-radius: 20px;
    font-size: 13px; font-weight: 600; margin: 8px auto 12px;
}
.btn-pulse { animation: btnPulse 2s ease-in-out infinite; }
@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(61, 26, 110, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(61, 26, 110, 0); }
}
.about-section { max-width: 480px; margin: 24px auto; padding: 0 16px; }
.about-section details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.about-section summary {
    padding: 14px 18px; cursor: pointer; font-weight: 600; font-size: 15px;
    color: var(--text); list-style: none; display: flex; align-items: center; justify-content: space-between;
}
.about-section summary::after { content: "+"; font-size: 18px; color: var(--accent, #a855f7); transition: transform 0.2s; }
.about-section details[open] summary::after { content: "\2212"; }
.about-section summary::-webkit-details-marker { display: none; }
.about-content { padding: 0 18px 18px; }
.about-content h2 { font-size: 16px; color: var(--accent, #a855f7); margin: 16px 0 8px; }
.about-content p { font-size: 14px; color: var(--text-dim); line-height: 1.7; }
