
/* ============================================
   QUIZ ENGINE v1.0 — Shared Styles
   Mitchy & Andre Design System
   Be Vietnam Pro + Open Sans | Teal + Gold | Glassmorphism
   Supports: inline mode ([data-quiz-mode="inline"])
             modal mode  ([data-quiz-mode="modal"])
   ============================================ */

/* === MODAL OVERLAY (nur bei modal mode) === */
[data-quiz-mode="modal"] .qe-backdrop {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  z-index: 99990; opacity: 0; visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
[data-quiz-mode="modal"].qe-active .qe-backdrop {
  opacity: 1; visibility: visible;
}
[data-quiz-mode="modal"] .qe-container {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 92%; max-width: 680px; max-height: 88vh;
  overflow-y: auto; z-index: 99991;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}
[data-quiz-mode="modal"].qe-active .qe-container {
  opacity: 1; visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}
[data-quiz-mode="modal"] .qe-close {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.8); border: 1px solid rgba(0,0,0,0.1);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #555; transition: background 0.2s;
}
[data-quiz-mode="modal"] .qe-close:hover { background: #fff; }

/* === INLINE MODE === */
[data-quiz-mode="inline"] .qe-backdrop,
[data-quiz-mode="inline"] .qe-close { display: none; }
[data-quiz-mode="inline"] .qe-container {
  max-width: 760px; margin: 0 auto; padding: 20px 0 40px;
}

/* === QUIZ ROOT VARS === */
[data-quiz] {
  --qe-accent: var(--teal, #56B6C4);
  --qe-accent-hover: var(--teal-dark, #479DA9);
  --qe-accent-dark: var(--teal-deeper, #3A8490);
  --qe-accent-soft: var(--teal-light, #E8F5F7);
  --qe-accent-ghost: rgba(86, 182, 196, 0.12);
  --qe-gold: var(--gold, #C8962D);
  --qe-gold-soft: var(--gold-light, #f7eed8);
  --qe-gold-glow: rgba(200, 150, 45, 0.15);
  --qe-text: var(--dark, #212121);
  --qe-text-muted: var(--gray, #555555);
  --qe-bg: #ffffff;
  --qe-bg-light: var(--gray-bg, #F5F5F5);
  --qe-bg-soft: #f4f9fb;
  --qe-line: #e3edf0;
  --qe-shadow: 0 4px 24px rgba(0,0,0,0.06);
  --qe-shadow-accent: 0 8px 32px rgba(86,182,196,0.25);
  --qe-radius-sm: 8px;
  --qe-radius-md: 12px;
  --qe-radius-lg: 20px;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px; line-height: 1.6; color: var(--qe-text);
  -webkit-font-smoothing: antialiased;
}
[data-quiz] *, [data-quiz] *::before, [data-quiz] *::after { box-sizing: border-box; }

/* === PROGRESS BAR === */
[data-quiz] .qe-progress { width: 100%; height: 4px; background: var(--qe-line); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
[data-quiz] .qe-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--qe-accent), var(--qe-gold)); border-radius: 2px; transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1); }

/* === WIZARD BOX (Glassmorphism) === */
[data-quiz] .qe-wizard {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: var(--qe-radius-lg);
  border: 1px solid rgba(86,182,196,0.15);
  box-shadow: var(--qe-shadow);
  overflow: hidden; min-height: 380px;
  display: flex; flex-direction: column;
}

/* === PAGES === */
[data-quiz] .qe-page { display: none; flex: 1; animation: qeFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
[data-quiz] .qe-page.is-active { display: flex; flex-direction: column; }
@keyframes qeFadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* === INTRO === */
[data-quiz] .qe-intro {
  text-align: center; padding: 48px 24px 40px; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--qe-accent-soft) 0%, #d4eeec 50%, var(--qe-gold-soft) 100%);
  position: relative; overflow: hidden;
}
[data-quiz] .qe-intro::before {
  content: ''; position: absolute; top: -50%; right: -30%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--qe-gold-glow) 0%, transparent 70%);
  filter: blur(60px); pointer-events: none;
}
[data-quiz] .qe-intro-badge {
  display: inline-block; background: rgba(86,182,196,0.15);
  color: var(--qe-accent-dark); font-size: 13px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 16px; border-radius: 20px; margin-bottom: 16px; position: relative;
}
[data-quiz] .qe-intro h3 {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: clamp(1.5rem, 6vw, 2.2rem); font-weight: 700;
  color: var(--qe-text); line-height: 1.2;
  margin: 0 0 10px; text-transform: none; letter-spacing: 0; position: relative;
}
[data-quiz] .qe-intro p {
  font-size: clamp(0.95rem, 3.5vw, 1.1rem); color: var(--qe-text-muted);
  max-width: 520px; margin: 0 auto 24px; position: relative;
}
[data-quiz] .qe-intro-features {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
  margin-bottom: 20px; position: relative;
}
[data-quiz] .qe-intro-features span {
  font-size: 13px; color: var(--qe-accent-dark); font-weight: 600;
}
[data-quiz] .qe-start-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--qe-accent), var(--qe-accent-hover));
  color: #fff; font-family: inherit; font-size: 16px; font-weight: 700;
  border: none; border-radius: var(--qe-radius-md); cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
  box-shadow: var(--qe-shadow-accent); position: relative;
}
[data-quiz] .qe-start-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(86,182,196,0.3); }

/* === QUESTION PAGES === */
[data-quiz] .qe-q-content { padding: 28px 24px 20px; flex: 1; }
[data-quiz] .qe-q-header { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
[data-quiz] .qe-q-num {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--qe-accent-ghost); color: var(--qe-accent-dark);
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
[data-quiz] .qe-q-header h4 {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: clamp(1rem, 3.8vw, 1.2rem); font-weight: 700;
  color: var(--qe-text); line-height: 1.3;
  text-transform: none; letter-spacing: 0; margin: 0;
}
[data-quiz] .qe-multi-hint {
  font-size: 13px; color: var(--qe-accent-dark); font-weight: 600;
  margin: 0 0 10px 48px; display: flex; align-items: center; gap: 6px;
}

/* === ANSWER CARDS === */
[data-quiz] .qe-answers { display: grid; gap: 10px; margin-top: 14px; }
[data-quiz] .qe-a {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; background: var(--qe-bg-light);
  border: 2px solid transparent; border-radius: var(--qe-radius-md);
  cursor: pointer; transition: all 0.25s ease;
  -webkit-user-select: none; user-select: none;
}
[data-quiz] .qe-a:hover {
  background: var(--qe-accent-soft); border-color: var(--qe-accent);
  transform: translateX(4px); box-shadow: var(--qe-shadow);
}
[data-quiz] .qe-a-icon {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--qe-radius-sm);
  background: var(--qe-bg); font-size: 19px; flex-shrink: 0;
  transition: transform 0.25s;
}
[data-quiz] .qe-a:hover .qe-a-icon { transform: scale(1.1); }
[data-quiz] .qe-a-text { font-size: 15px; font-weight: 600; color: var(--qe-text); line-height: 1.4; }
[data-quiz] .qe-a.is-selected { background: var(--qe-accent-soft); border-color: var(--qe-accent); }
[data-quiz] .qe-a.is-selected .qe-a-icon { background: var(--qe-accent); color: #fff; }
[data-quiz] .qe-a-check {
  margin-left: auto; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--qe-line); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; transition: all 0.2s;
  font-size: 12px; color: transparent;
}
[data-quiz] .qe-a.is-selected .qe-a-check {
  border-color: var(--qe-accent); background: var(--qe-accent); color: #fff;
}

/* === CONTINUE BUTTON (multi-select) === */
[data-quiz] .qe-continue-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px; margin-top: 14px;
  background: linear-gradient(135deg, var(--qe-accent), var(--qe-accent-hover));
  color: #fff; font-family: inherit; font-size: 15px; font-weight: 700;
  border: none; border-radius: var(--qe-radius-md); cursor: pointer;
  transition: all 0.25s; box-shadow: var(--qe-shadow-accent);
}
[data-quiz] .qe-continue-btn:hover:not(:disabled) { transform: translateY(-1px); }
[data-quiz] .qe-continue-btn:disabled { opacity: 0.35; cursor: default; }
[data-quiz] .qe-select-count { font-size: 12px; color: var(--qe-text-muted); font-weight: 600; text-align: center; margin-top: 6px; }

/* === BOTTOM NAV === */
[data-quiz] .qe-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-top: 1px solid var(--qe-line);
  background: rgba(244,249,251,0.6); backdrop-filter: blur(6px);
}
[data-quiz] .qe-nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--qe-radius-sm);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  border: 1px solid var(--qe-line); background: var(--qe-bg); color: var(--qe-text);
}
[data-quiz] .qe-nav-btn:hover:not(:disabled) { border-color: var(--qe-accent); color: var(--qe-accent-dark); background: var(--qe-accent-soft); }
[data-quiz] .qe-nav-btn:disabled { opacity: 0.35; cursor: default; }
[data-quiz] .qe-nav-btn.is-primary {
  background: linear-gradient(135deg, var(--qe-accent), var(--qe-accent-hover));
  color: #fff; border-color: transparent;
}
[data-quiz] .qe-nav-btn.is-primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--qe-accent-hover), var(--qe-accent-dark)); color: #fff; }
[data-quiz] .qe-nav-dots { display: flex; gap: 5px; }
[data-quiz] .qe-nav-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--qe-line); transition: all 0.3s; }
[data-quiz] .qe-nav-dot.is-done { background: var(--qe-accent); }
[data-quiz] .qe-nav-dot.is-current { background: var(--qe-accent); transform: scale(1.4); }

/* === RESULT HERO === */
[data-quiz] .qe-result-hero {
  padding: 36px 24px 28px; text-align: center;
  position: relative; overflow: hidden;
}
[data-quiz] .qe-result-emoji { font-size: 56px; display: block; margin-bottom: 14px; animation: qeEmojiPop 0.6s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes qeEmojiPop { from { transform: scale(0) rotate(-20deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
[data-quiz] .qe-result-label {
  display: inline-block; font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--qe-text-muted); margin-bottom: 6px;
}
[data-quiz] .qe-result-type {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: clamp(1.4rem, 6vw, 2rem); font-weight: 700;
  line-height: 1.2; margin-bottom: 4px;
}
[data-quiz] .qe-result-desc { font-size: 15px; color: var(--qe-text); max-width: 500px; margin: 0 auto; line-height: 1.6; }

/* === MATCH BADGE === */
[data-quiz] .qe-match-badge {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; margin: 16px 24px 0;
  background: var(--qe-accent-soft); border-radius: var(--qe-radius-md);
  border: 1px solid rgba(86,182,196,0.2);
}
[data-quiz] .qe-match-badge span { font-size: 20px; flex-shrink: 0; }
[data-quiz] .qe-match-badge strong { font-size: 14px; color: var(--qe-accent-dark); line-height: 1.4; }
[data-quiz] .qe-match-badge.qe-match-soft {
  background: var(--qe-gold-soft); border-color: rgba(200,150,45,0.2);
}
[data-quiz] .qe-match-badge.qe-match-soft strong { color: var(--gold-dark, #A87B1F); }

/* === PARTY LEVEL / ENERGY METER === */
[data-quiz] .qe-level { padding: 20px 24px; border-top: 1px solid var(--qe-line); text-align: center; }
[data-quiz] .qe-level h5 {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--qe-text-muted); margin: 0 0 12px;
}
[data-quiz] .qe-level-bar { display: flex; gap: 4px; justify-content: center; margin-bottom: 8px; }
[data-quiz] .qe-level-seg { width: 48px; height: 10px; border-radius: 5px; background: var(--qe-bg-light); transition: background 0.4s; }
[data-quiz] .qe-level-seg.is-filled { background: linear-gradient(135deg, var(--qe-accent), var(--qe-gold)); }
[data-quiz] .qe-level-label { font-size: 14px; font-weight: 700; color: var(--qe-accent-dark); }

/* === GENRE TAGS === */
[data-quiz] .qe-tags { padding: 16px 24px; border-top: 1px solid var(--qe-line); text-align: center; }
[data-quiz] .qe-tags h5 {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--qe-text-muted); margin: 0 0 10px;
}
[data-quiz] .qe-tags-wrap { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
[data-quiz] .qe-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 20px;
  font-size: 13px; font-weight: 600;
  background: var(--qe-accent-ghost); color: var(--qe-accent-dark);
}

/* === TIPS === */
[data-quiz] .qe-tips { padding: 20px 24px; border-top: 1px solid var(--qe-line); }
[data-quiz] .qe-tips h4 {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 15px; font-weight: 700; color: var(--qe-text); margin: 0 0 10px;
}
[data-quiz] .qe-tips ul { list-style: none; padding: 0; margin: 0; }
[data-quiz] .qe-tips li {
  padding: 8px 0 8px 24px; font-size: 14px; color: var(--qe-text);
  position: relative; line-height: 1.5;
}
[data-quiz] .qe-tips li::before {
  content: '\2713'; position: absolute; left: 0;
  color: var(--qe-accent); font-weight: 700;
}

/* === SCORE BARS (Musik-Profil) === */
[data-quiz] .qe-scores { padding: 24px; border-top: 1px solid var(--qe-line); }
[data-quiz] .qe-scores h5 {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--qe-text-muted); margin: 0 0 16px; text-align: center;
}
[data-quiz] .qe-score-row { margin-bottom: 12px; }
[data-quiz] .qe-score-row:last-child { margin-bottom: 0; }
[data-quiz] .qe-score-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
[data-quiz] .qe-score-name { font-size: 13px; font-weight: 600; color: var(--qe-text); }
[data-quiz] .qe-score-pct { font-size: 12px; font-weight: 700; color: var(--qe-text-muted); }
[data-quiz] .qe-score-bar { height: 8px; background: var(--qe-bg-light); border-radius: 4px; overflow: hidden; }
[data-quiz] .qe-score-fill { height: 100%; border-radius: 4px; width: 0%; transition: width 1s cubic-bezier(0.16, 1, 0.3, 1); }

/* === SONG LIST === */
[data-quiz] .qe-songs { padding: 24px; border-top: 1px solid var(--qe-line); }
[data-quiz] .qe-songs h4 {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: clamp(1rem, 4vw, 1.15rem); font-weight: 700;
  color: var(--qe-text); margin: 0 0 4px; text-align: center;
}
[data-quiz] .qe-songs-sub { font-size: 13px; color: var(--qe-text-muted); text-align: center; margin: 0 0 14px; }
[data-quiz] .qe-song-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
[data-quiz] .qe-song {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; background: var(--qe-bg-light);
  border-radius: var(--qe-radius-sm);
  opacity: 0; transform: translateX(-12px);
}
[data-quiz] .qe-song.is-visible { animation: qeSongSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes qeSongSlide { to { opacity: 1; transform: translateX(0); } }
[data-quiz] .qe-song-note { font-size: 16px; flex-shrink: 0; }
[data-quiz] .qe-song-info { min-width: 0; flex: 1; }
[data-quiz] .qe-song-title { font-size: 13px; font-weight: 700; color: var(--qe-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-quiz] .qe-song-artist { font-size: 12px; color: var(--qe-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* === CTA BUTTONS === */
[data-quiz] .qe-cta-wrap { text-align: center; padding: 20px 24px; border-top: 1px solid var(--qe-line); }
[data-quiz] .qe-cta-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 34px;
  background: linear-gradient(135deg, var(--qe-accent), var(--qe-accent-hover));
  color: #fff; font-family: inherit; font-size: 16px; font-weight: 700;
  border: none; border-radius: var(--qe-radius-md); cursor: pointer;
  text-decoration: none; transition: transform 0.25s, box-shadow 0.25s;
  box-shadow: var(--qe-shadow-accent);
}
[data-quiz] .qe-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(86,182,196,0.28); color: #fff; }
[data-quiz] .qe-sec-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
[data-quiz] .qe-sec-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; background: var(--qe-bg);
  border: 1px solid var(--qe-line); border-radius: var(--qe-radius-sm);
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--qe-text); cursor: pointer; transition: all 0.2s;
}
[data-quiz] .qe-sec-btn:hover { border-color: var(--qe-accent); color: var(--qe-accent-dark); background: var(--qe-accent-soft); }

/* === DJ HINT === */
[data-quiz] .qe-dj-hint {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 20px; margin: 0 24px 16px;
  background: var(--qe-bg-soft); border-radius: var(--qe-radius-md);
  border: 1px solid var(--qe-line);
}
[data-quiz] .qe-dj-hint .qe-dj-icon { font-size: 24px; flex-shrink: 0; }
[data-quiz] .qe-dj-hint strong { font-size: 14px; color: var(--qe-text); display: block; margin-bottom: 2px; }
[data-quiz] .qe-dj-hint p { font-size: 13px; color: var(--qe-text-muted); margin: 0; line-height: 1.5; }

/* === CONFETTI === */
.qe-confetti { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 99999; overflow: hidden; }
.qe-confetti-piece { position: absolute; top: -20px; animation: qeConfetti linear forwards; }
@keyframes qeConfetti { 0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(100vh) rotate(720deg) scale(0.5); opacity: 0; } }

/* === MOBILE === */
@media (max-width: 544px) {
  [data-quiz] .qe-intro { padding: 32px 16px 28px; }
  [data-quiz] .qe-q-content { padding: 20px 16px 14px; }
  [data-quiz] .qe-q-header { gap: 8px; }
  [data-quiz] .qe-q-num { width: 30px; height: 30px; font-size: 12px; }
  [data-quiz] .qe-multi-hint { margin-left: 38px; font-size: 12px; }
  [data-quiz] .qe-a { padding: 12px 12px; gap: 8px; }
  [data-quiz] .qe-a-icon { width: 32px; height: 32px; font-size: 16px; }
  [data-quiz] .qe-a-text { font-size: 13px; }
  [data-quiz] .qe-nav { padding: 12px 16px; }
  [data-quiz] .qe-result-hero { padding: 24px 16px 20px; }
  [data-quiz] .qe-result-emoji { font-size: 44px; }
  [data-quiz] .qe-scores { padding: 16px; }
  [data-quiz] .qe-level { padding: 16px; }
  [data-quiz] .qe-tags { padding: 12px 16px; }
  [data-quiz] .qe-songs { padding: 16px; }
  [data-quiz] .qe-song { padding: 8px 10px; gap: 8px; }
  [data-quiz] .qe-level-seg { width: 36px; }
  [data-quiz] .qe-song-grid { grid-template-columns: 1fr; }
  [data-quiz] .qe-cta-wrap { padding: 16px; }
  [data-quiz] .qe-tips { padding: 16px; }
  [data-quiz-mode="modal"] .qe-container { width: 96%; max-height: 92vh; }
}
