/* static/css/funnel/pbe.css
 * ════════════════════════════════════════════════════════════
 * Play By Ear funnel styles
 *
 *   1.  Piano keyboard (note-guess questions)
 *   2.  Per-question feedback screen
 *   3.  Animations
 *   4.  Background video (mood questions)
 *   5.  Play-screen layout (test module)
 *   6.  Teacher intro (RPG dialogue)
 *   7.  Stems-pick icons
 *   8.  Test module — choice / binary buttons
 *   9.  Questionnaire — shared
 *   10. Questionnaire — single & multi select
 *   11. Questionnaire — agree_scale (thumbs row)
 *   12. Questionnaire — intensity (signal bars)
 * ════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════
   1. PIANO KEYBOARD
   ════════════════════════════════════════════════════════════ */
.pbe-piano {
  position: relative;
  height: 90px;
  width: 100%;
  max-width: 360px;
  margin: 16px auto 0;
  background: #0e0820;
  border-radius: 4px 4px 6px 6px;
  padding: 0 2px 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.pbe-pkey {
  position: absolute;
  border: none;
  outline: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.07s;
  -webkit-tap-highlight-color: transparent;
}

.pbe-pkey-w {
  top: 0;
  bottom: 0;
  width: calc(14.286% - 2px);
  background: linear-gradient(180deg, #e8e0f8 0%, #cfc6e8 100%);
  border-left: 1px solid rgba(108, 92, 231, 0.15);
  border-right: 1px solid rgba(108, 92, 231, 0.15);
  border-bottom: 3px solid rgba(80, 60, 180, 0.2);
  border-radius: 0 0 4px 4px;
  z-index: 1;
}

.pbe-pkey-b {
  top: 0;
  height: 56%;
  width: 7%;
  background: linear-gradient(180deg, #2a1f4a 0%, #0e0820 100%);
  border: 1px solid rgba(0, 0, 0, 0.6);
  border-top: none;
  border-radius: 0 0 3px 3px;
  z-index: 2;
}

.pbe-pkey-w:hover {
  filter: brightness(1.08);
}

.pbe-pkey-b:hover {
  filter: brightness(1.3);
}

.pbe-pkey.pbe-key-selected {
  background: linear-gradient(180deg, #a29bfe, #6c5ce7) !important;
  box-shadow: 0 0 12px rgba(108, 92, 231, 0.6) !important;
}

.pbe-pkey.pbe-key-correct {
  background: linear-gradient(180deg, #00e0b8, #00b894) !important;
  box-shadow: 0 0 12px rgba(0, 184, 148, 0.5) !important;
}

.pbe-pkey.pbe-key-wrong {
  background: linear-gradient(180deg, #ff7675, #e17055) !important;
  box-shadow: 0 0 8px rgba(225, 112, 85, 0.5) !important;
}

.pbe-piano-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.pbe-attempts-row {
  text-align: center;
  font-size: 0.75rem;
  color: var(--pf-text-dim);
  margin: 8px 0 4px;
  letter-spacing: 0.04em;
}

.pbe-attempts-label {
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════════
   2. PER-QUESTION FEEDBACK SCREEN
   ════════════════════════════════════════════════════════════ */
.pbe-feedback-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 24px 16px;
  text-align: center;
}

.pbe-feedback-img-wrap {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 16 / 9;
  background: var(--pf-bg-card);
  border-radius: var(--pf-radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

.pbe-feedback-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ════════════════════════════════════════════════════════════
   3. ANIMATIONS
   ════════════════════════════════════════════════════════════ */
@keyframes pbeShake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-8px);
  }

  40% {
    transform: translateX(8px);
  }

  60% {
    transform: translateX(-6px);
  }

  80% {
    transform: translateX(6px);
  }
}

.pbe-shake {
  animation: pbeShake 0.5s ease;
}

/* ════════════════════════════════════════════════════════════
   4. BACKGROUND VIDEO (mood questions)
   ════════════════════════════════════════════════════════════ */
.pbe-video-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: 16px;
}

.pbe-video-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.4s ease;
  /* smooth unblur when staged class drops */
}

.pbe-video-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .30), rgba(0, 0, 0, .55));
}

.pbe-video-bg.pbe-video-staged video {
  filter: blur(12px) brightness(0.7);
  transform: scale(1.08);
  /* hides blurred edges */
}

/* ════════════════════════════════════════════════════════════
   5. PLAY-SCREEN LAYOUT (test module)
   ════════════════════════════════════════════════════════════ */
.step-pbe-module #eiq-play-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  gap: 16px;
  padding: 40px 0 16px;
}

/* keep prompt / button / choices above the video */
.step-pbe-module #eiq-play-screen>*:not(.pbe-video-bg) {
  z-index: 1;
}

.step-pbe-module #eiq-play-screen > *:not(.rpg-dialogue-sm):not(.play-btn--compact) {
  margin-top: 60px;
}

/* only when a bg video is active, go tall so cover doesn't crop */
.step-pbe-module #eiq-play-screen.pbe-has-video {
  min-height: 80vh;
}

/* eiq-intro layout (mirrors EIQ module) */
.step-pbe-module #eiq-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  gap: 0;
  padding: 24px 16px 16px;
}

.step-pbe-module #eiq-intro .rp-phase-title {
  margin: 0 0 10px;
}

.step-pbe-module #eiq-intro .rp-phase-icon {
  margin: 0 auto 20px;
  aspect-ratio: 1 / 1;
  min-height: unset;
  max-height: unset;
}

.step-pbe-module #eiq-intro .rp-phase-body {
  margin: 0 0 32px;
}

.step-pbe-module #eiq-intro .rp-phase-continue {
  margin-top: 0;
}

/* ════════════════════════════════════════════════════════════
   6. TEACHER INTRO (RPG dialogue)
   ════════════════════════════════════════════════════════════ */
.teacher-intro-stage {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 16px;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #1a1140 0%, #0e0820 70%);
}

.teacher-intro-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.teacher-intro-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  /* keep heads, never crop the top */
  display: block;
}

/* fade the bottom so the dialogue stays legible over the character */
.teacher-intro-video-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14, 8, 32, 0) 45%, rgba(14, 8, 32, 0.85) 100%);
  pointer-events: none;
}

.rpg-dialogue {
  position: relative;
  z-index: 1;
  margin: 0 12px 16px;
  padding: 20px 20px 16px;
  background: rgb(14 8 32 / 60%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 2px solid var(--pf-accent, #a29bfe);
  border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 0 22px rgba(108, 92, 231, 0.35);
  animation: rpgDialogueIn 0.35s ease both;
}

@keyframes rpgDialogueIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rpg-dialogue-nametag {
  position: absolute;
  top: -14px;
  left: 16px;
  padding: 4px 14px;
  font-family: 'Unbounded', 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0e0820;
  background: linear-gradient(180deg, #a29bfe, #6c5ce7);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.5);
}

.rpg-dialogue-text {
  margin: 4px 0 0;
  min-height: 3.4em;
  /* reserve space so layout doesn't jump while typing */
  font-size: 0.95rem;
  line-height: 1.5;
  color: #f3f0ff;
  white-space: pre-wrap;
  text-align: left;
}

@media (min-width: 480px) {
  .rpg-dialogue-text {
    font-size: 1rem;
  }
}

.rpg-dialogue-indicator {
  display: none;
  position: absolute;
  right: 16px;
  bottom: 12px;
  color: var(--pf-accent, #a29bfe);
  font-size: 0.85rem;
  animation: rpgBlink 1s steps(2, start) infinite;
}

@keyframes rpgBlink {
  50% {
    opacity: 0.15;
  }
}

.rpg-dialogue-continue {
  margin-top: 16px;
  width: 100%;
  max-width: 100%;
  border-radius: 16px;
  transition: opacity 0.3s ease;
}

.rpg-dialogue-continue.is-hidden {
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {

  .rpg-dialogue,
  .rpg-dialogue-indicator {
    animation: none;
  }
}

/* ════════════════════════════════════════════════════════════
   RPG DIALOGUE SM — compact teacher prompt used in pbe_module
   Avatar sits bottom-left; bubble floats to the right.
   Only referenced by pbe_module.html — zero impact on other funnels.
   ════════════════════════════════════════════════════════════ */
.rpg-dialogue-sm {
  display: flex;
  align-items: stretch;
  width: 100%;
  gap: 10px;
  margin: 0 0 12px;
  animation: rpgDialogueIn 0.35s ease both;
  justify-content: flex-start;
  flex-direction: column;
}

.rpg-dialogue-sm-avatar {
  position: absolute;
      top: -60px;
    left: 10px;
    width: 100px;
  height: auto;
  flex-shrink: 0;
  object-fit: cover;
  object-position: center top;
}

.rpg-dialogue-sm-bubble {
  position: relative;
  top: 90px;
  flex: 1;
  background: rgb(14 8 32 / 72%);
  backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1.5px solid var(--pf-accent, #a29bfe);
    border-radius: 16px;
    padding: 16px 14px 16px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 0 16px rgba(108, 92, 231, 0.25);
    top: 40px;
    min-height: 80px;
  }

.rpg-dialogue-sm-nametag {
  position: absolute;
  top: -11px;
  left: 12px;
  padding: 3px 10px;
  font-family: 'Unbounded', 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0e0820;
  background: linear-gradient(180deg, #a29bfe, #6c5ce7);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.5);
}

.rpg-dialogue-sm-text {
  margin: 8px 0 0;
  min-height: 2.4em;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #f3f0ff;
  white-space: pre-wrap;
  text-align: left;
      padding: 0 16px;
}

@media (min-width: 480px) {
  .rpg-dialogue-sm-text {
    font-size: 0.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rpg-dialogue-sm {
    animation: none;
  }
}

/* ════════════════════════════════════════════════════════════
   7. STEMS-PICK ICONS
   ════════════════════════════════════════════════════════════ */
.eiq-stems-guitar {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.eiq-stems-guitar--a {
  filter: hue-rotate(0deg) saturate(1.4) brightness(0.95);
}

/* purple */
.eiq-stems-guitar--b {
  filter: hue-rotate(150deg) saturate(1.6) brightness(0.9);
}

/* teal */

/* ════════════════════════════════════════════════════════════
   8. TEST MODULE — choice / binary buttons
   ════════════════════════════════════════════════════════════ */
.step-pbe-module .eiq-choices,
.step-pbe-module .eiq-binary-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  width: 100%;
  max-width: 440px;
  margin: 8px auto 0;
}

.step-pbe-module .eiq-answer-btn {
  flex: 1 1 0;
  min-width: 190px;
  min-height: 66px;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 18px 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  background: var(--pf-bg-card);
  border: 2px solid var(--pf-border);
  color: var(--pf-text);
  font-family: var(--pf-font);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.08s;
  -webkit-tap-highlight-color: transparent;
}

.step-pbe-module .eiq-answer-btn:hover:not(:disabled) {
  border-color: var(--pf-primary);
  background: rgba(108, 92, 231, 0.12);
  transform: translateY(-1px);
}

.step-pbe-module .eiq-answer-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.step-pbe-module .eiq-answer-btn.chosen {
  border-color: var(--pf-primary) !important;
  background: rgba(108, 92, 231, 0.275) !important;
  box-shadow: 0 0 14px rgba(108, 92, 231, 0.5);
}

.step-pbe-module .pbe-choice-icon--up {
  color: var(--pf-success);
  font-size: 1.15em;
}

.step-pbe-module .pbe-choice-icon--down {
  color: var(--pf-error);
  font-size: 1.15em;
}

.step-pbe-module .eiq-stems-replay-wrap {
  margin: 12px 0 0;
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
}

/* Same = green icon, Different = red icon (icon only, not the button) */
.step-pbe-module .eiq-answer-btn[data-value="same"] .bi {
  color: var(--pf-success);
  font-size: 1.1em;
}

.step-pbe-module .eiq-answer-btn[data-value="different"] .bi {
  color: var(--pf-error);
  font-size: 1.1em;
}

/* ════════════════════════════════════════════════════════════
   9. QUESTIONNAIRE — shared
   ════════════════════════════════════════════════════════════ */
/* visually-hidden accessible label (used by agree_scale emoji) */
.step-pbe-question .pbe-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ════════════════════════════════════════════════════════════
   10. QUESTIONNAIRE — single & multi select
   ════════════════════════════════════════════════════════════ */
.step-pbe-question .choice-btn {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  text-align: left;
  min-width: 0;
  font-weight: 400;
  padding: 12px 18px;
}

.step-pbe-question .choice-btn .choice-visual--sm {
  width: 48px;
  height: 48px;
  min-width: 48px;
}

.step-pbe-question .choice-btn .choice-visual--sm .choice-icon {
  width: 48px;
  height: 48px;
  max-height: 48px;
}

.step-pbe-question .choice-btn .choice-label {
  flex: 1;
  text-align: left;
  font-weight: 400;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}

/* Multi-select: single column, equal-width, text wraps */
.step-pbe-question .multi-choice-grid {
  flex-direction: column;
}

.step-pbe-question .multi-choice-grid .choice-btn {
  flex: 0 0 100%;
  min-width: 0;
  min-height: 56px;
  height: auto;
}

/* ── PBE-only: eiq-intro layout (mirrors EIQ module) ─────── */
.step-pbe-module #eiq-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  gap: 0;
}

.step-pbe-module #eiq-intro .rp-phase-title {
  margin: 0 0 10px;
}

.step-pbe-module #eiq-intro .rp-phase-icon {
  margin: 0 auto 20px;
}

.step-pbe-module #eiq-intro .rp-phase-body {
  margin: 0 0 32px;
  text-align: left;
  width: 100%;
}

.step-pbe-module #eiq-intro .rp-phase-continue {
  margin-top: 0;
}

/* ── PBE feedback screen — consistent spacing ─────────────── */
.pbe-feedback-inner {
  gap: 0 !important;
}

.pbe-feedback-inner .rp-phase-title {
  margin: 0 0 20px;
}

.pbe-feedback-inner .pbe-feedback-img-wrap {
  margin: 0 auto 20px;
}

.pbe-feedback-inner .rp-phase-body {
  margin: 0 0 32px;
}

.pbe-feedback-inner .btn-primary-music {
  margin-top: 0;
}

/* ═══════════════════════════════════════════════════════════
   PBE QUESTION — Yes / No icon colouring
   ═══════════════════════════════════════════════════════════ */

.step-pbe-question .choice-btn[data-value="yes"] .bi,
.step-pbe-question .choice-btn[data-value="yes_very"] .bi,
.step-pbe-question .choice-btn[data-value="yes_somewhat"] .bi {
  color: var(--pf-success);
  font-size: 1.1em;
}

.step-pbe-question .choice-btn[data-value="no"] .bi,
.step-pbe-question .choice-btn[data-value="never_tried"] .bi {
  color: var(--pf-error);
  font-size: 1.1em;
}

/* ════════════════════════════════════════════════════════════
   11. QUESTIONNAIRE — agree_scale (segmented thumbs row)
   ════════════════════════════════════════════════════════════ */

/* Fixed container — anchors the agree row 140px from top regardless of title length */
.step-pbe-question .pbe-agree-container {
  position: fixed;
  top: 200px;
  left: 0;
  right: 0;
  padding: 0 24px;
  z-index: 10;
}

.step-pbe-question .pbe-agree-substep {
  margin: 0 0 16px;
  text-align: center;
  letter-spacing: 0.01em;
}

/* Single bordered segmented-control container */
.step-pbe-question .pbe-agree-row {
  display: flex;
  width: 100%;
  background: var(--pf-bg-card);
  border: 2px solid var(--pf-border);
  border-radius: 16px;
  /* No overflow:hidden — lets selected border on end buttons show with radius */
  margin: 20px 0;
}

/* Each segment */
.step-pbe-question .pbe-agree-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 0;
  background: transparent;
  border: none;
  border-right: 1px solid var(--pf-border);
  /* divider */
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, transform 0.08s;
  position: relative;
  outline: none;
}

.step-pbe-question .pbe-agree-btn:first-child {
  border-radius: 14px 0 0 14px;
}

.step-pbe-question .pbe-agree-btn:last-child {
  border-right: none;
  border-radius: 0 14px 14px 0;
}

/* Hover — mirrors choice-btn hover */
.step-pbe-question .pbe-agree-btn:hover:not(:disabled) {
  background: rgba(108, 92, 231, 0.08);
}

.step-pbe-question .pbe-agree-btn:active:not(:disabled) {
  background: rgba(108, 92, 231, 0.14);
}

/* Selected — mirrors choice-btn.selected */
.step-pbe-question .pbe-agree-btn.selected {
  background: rgba(108, 92, 231, 0.275);
  outline: 2px solid var(--pf-primary);
}

/* Emoji images */
.step-pbe-question .pbe-agree-emoji {
  display: block;
  user-select: none;
  transition: transform 0.12s;
  object-fit: contain;
}

/* Scale: XL outer, MD middle, SM centre */
.step-pbe-question .pbe-agree-xl {
  width: 2rem;
  height: 2rem;
}

.step-pbe-question .pbe-agree-md {
  width: 1.5rem;
  height: 1.5rem;
}

.step-pbe-question .pbe-agree-sm {
  width: 1.5rem;
  height: 1.5rem;
}

.step-pbe-question .pbe-agree-btn:hover .pbe-agree-emoji,
.step-pbe-question .pbe-agree-btn.selected .pbe-agree-emoji {
  transform: scale(1.18);
}

/* Anchor labels below the row */
.step-pbe-question .pbe-agree-anchors {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--pf-text-dim);
  padding: 0 4px;
  margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════
   PBE MODULE — Play button ring-progress
   Same 84px size always — background swaps + ring on play
   ═══════════════════════════════════════════════════════════ */

/* Hide sound wave — ring replaces it as the playing indicator */
.step-pbe-module #eiq-wave {
  display: none !important;
}

/* Wrapper: always 84px — no size change on play */
.step-pbe-module .play-btn-ring-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
}

/* SVG ring — hidden until the button is actively playing */
.step-pbe-module .pbe-play-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  transform: rotate(-90deg);
  /* arc starts at 12-o'clock */
  pointer-events: none;
  z-index: 1;
}

.step-pbe-module .play-btn.playing .pbe-play-ring {
  display: block;
}

/* Dim track — subtle ring, always present */
.step-pbe-module .pbe-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 6;
}

/* Progress arc — starts empty; JS sets to 0 (full) on play start then drains */
.step-pbe-module .pbe-ring-fill {
  fill: none;
  stroke: var(--pf-accent, #a29bfe);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 276.46;
  /* 2π × 44 */
  stroke-dashoffset: 276.46;
  /* empty at rest; JS drives to 0 on play */
}

/* ── Playing state ───────────────────────────────────────── */

/* Playing: hide green background so only the ring + wave are visible */
.step-pbe-module .play-btn.playing .play-btn-inner {
  background: transparent !important;
  box-shadow: none !important;
  animation: none !important;
}

/* ── play-icon ↔ pbe-play-wave icon swap ────────────────── */

/* Default: triangle visible, wave hidden */
.step-pbe-module .play-btn-inner .play-icon     { display: block; }
.step-pbe-module .play-btn-inner .pbe-play-wave { display: none;  }

/* Playing: triangle hidden, wave visible */
.step-pbe-module .play-btn.playing .play-btn-inner .play-icon     { display: none; }
.step-pbe-module .play-btn.playing .play-btn-inner .pbe-play-wave { display: flex;  }

/* ── pbe-play-wave — 3-bar audio wave (mirrors eiq-stems-listen-wave) ── */
@keyframes pbe-play-wave {
  0%, 100% { transform: scaleY(0.35); }
  50%       { transform: scaleY(1.0);  }
}

.pbe-play-wave {
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 16px;
}

.pbe-play-wave .wave-bar {
  width: 3px;
  height: 16px;
  background: var(--pf-accent);
  border-radius: 2px;
  transform-origin: bottom;
  animation: pbe-play-wave 0.9s ease-in-out infinite;
}

.pbe-play-wave .wave-bar:nth-child(1) { animation-delay: 0s;    }
.pbe-play-wave .wave-bar:nth-child(2) { animation-delay: 0.15s; }
.pbe-play-wave .wave-bar:nth-child(3) { animation-delay: 0.30s; }

/* ── Compact state — dissolve the ring-wrap so play-btn-inner sits directly in the pill ── */
.step-pbe-module .play-btn--compact .play-btn-ring-wrap {
  display: contents;
}

/* Ring SVG also gone in compact */
.step-pbe-module .play-btn--compact .pbe-play-ring {
  display: none;
}


/* ── Compact: reorder below choices using flex order ── */
/* Default order for all play-screen children is 0.     */
/* Choices sit at order 0 so compact button (order 20)  */
/* always renders after them with no DOM change needed. */
.step-pbe-module #eiq-play-btn.play-btn--compact {
  order: 20;
}

/* ── Piano replay button — same compact size as all other replay buttons ── */
.step-pbe-module #pbe-replay-btn .play-btn-ring-wrap {
  width: 36px;
  height: 36px;
}


/* ════════════════════════════════════════════════════════════
   13. RESULT STEP — pbe_profile (ear-profile summary)
   Moved out of templates/funnel/steps/pbe_profile.html — inline
   <style> siblings are dropped by transitions.js (it appends only
   the .step-card node). All vars scoped to .pbe-prof.
   ════════════════════════════════════════════════════════════ */
.pbe-prof {
  --pp-card: #171228;
  --pp-line: #2a2140;
  --pp-ink: #f4f1fb;
  --pp-dim: #a99fc7;
  --pp-faint: #7d7399;
  --pp-violet: #7c5cff;
  --pp-violet2: #9d83ff;
  --c-exceptional: #00cec9;
  --c-strong: #34d399;
  --c-moderate: #9d83ff;
  --c-developing: #fbbf24;
  --c-baseline: #f87171;
}

.pbe-prof-hero {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(160deg, #241a44 0%, #15102a 100%);
  border: 1px solid var(--pp-line);
  padding: 22px 20px 18px;
}

.pbe-prof-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(420px 220px at 80% 0%, rgba(124, 92, 255, .35), transparent 70%),
    radial-gradient(360px 200px at 10% 110%, rgba(0, 206, 201, .18), transparent 70%);
}

.pbe-prof-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.pbe-prof-eyebrow {
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
}

.pbe-prof-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  color: #0e0a1a;
}

.pbe-prof-badge.exceptional {
  background: var(--c-exceptional)
}

.pbe-prof-badge.strong {
  background: var(--c-strong)
}

.pbe-prof-badge.moderate {
  background: var(--c-moderate)
}

.pbe-prof-badge.developing {
  background: var(--c-developing)
}

.pbe-prof-badge.baseline {
  background: var(--c-baseline)
}

.pbe-prof-icon {
  position: relative;
  width: 92px;
  height: 92px;
  margin: 6px auto 4px;
  display: grid;
  place-items: center;
  font-size: 46px;
  border-radius: 24px;
  background: rgba(124, 92, 255, .12);
  border: 1px solid rgba(157, 131, 255, .3);
  box-shadow: 0 8px 40px rgba(124, 92, 255, .25);
}

.pbe-prof-name {
  position: relative;
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  margin: 8px 0 4px;
  line-height: 1.15;
  color: var(--pp-ink);
}

.pbe-prof-tag {
  position: relative;
  text-align: center;
  color: var(--pp-dim);
  font-size: 15px;
  margin: 0 4px 18px;
  line-height: 1.45;
}

.pbe-prof-gauge {
  position: relative;
  margin: 46px 2px 6px;
  /* top room for the floating bubble */
}

.pbe-prof-track {
  position: relative;
  /* knob anchors here */
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--c-baseline) 0%, var(--c-developing) 38%,
      var(--c-moderate) 62%, var(--c-strong) 82%, var(--c-exceptional) 100%);
}

.pbe-prof-knob {
  position: absolute;
  top: 50%;
  left: var(--target);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #0e0a1a;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
  z-index: 2;
  animation: pbeKnobMove 1.1s cubic-bezier(.22, 1, .36, 1) .2s both;
}

.pbe-prof-bubble {
  position: absolute;
  left: var(--target);
  bottom: calc(100% + 4px);
  /* sit ABOVE the track, anchored to gauge top */
  transform: translateX(-50%);
  background: #fff;
  color: #0e0a1a;
  font-weight: 800;
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 5;
  /* the fix: paint above the track + knob */
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
  animation: pbeKnobMove 1.1s cubic-bezier(.22, 1, .36, 1) .2s both;
}

.pbe-prof-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #fff;
}

@keyframes pbeKnobMove {
  from {
    left: 4%
  }

  to {
    left: var(--target)
  }
}

.pbe-prof-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11px;
  color: var(--pp-faint);
  font-weight: 600;
}

.pbe-prof-desc {
  margin: 18px 0 0;
  padding: 16px;
  border-radius: 14px;
  position: relative;
  background: rgba(124, 92, 255, .08);
  border: 1px solid rgba(124, 92, 255, .18);
  color: var(--pp-dim);
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
}

.pbe-prof-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.pbe-prof-stat {
  background: var(--pp-card);
  border: 1px solid var(--pp-line);
  border-radius: 11px;
  padding: 9px 11px;
  text-align: left;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon label" "icon value";
  column-gap: 9px;
  align-items: center;
}

.pbe-prof-stat-icon {
  grid-area: icon;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 13px;
  background: rgba(124, 92, 255, .12);
  color: var(--pp-violet2);
}

.pbe-prof-stat-label {
  grid-area: label;
  align-self: end;
  font-size: 9.5px;
  color: var(--pp-faint);
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin: 0;
}

.pbe-prof-stat-value {
  grid-area: value;
  align-self: start;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 1px;
}

.pbe-prof-stat-pct {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--pp-faint);
}

.pbe-prof-stat .exceptional {
  color: var(--c-exceptional)
}

.pbe-prof-stat .strong {
  color: var(--c-strong)
}

.pbe-prof-stat .moderate {
  color: var(--c-moderate)
}

.pbe-prof-stat .developing {
  color: var(--c-developing)
}

.pbe-prof-stat .baseline {
  color: var(--c-baseline)
}

.pbe-prof-figure {
  position: relative;
  width: 100%;
  margin: 6px 0 4px;
  border-radius: 16px;
  overflow: hidden;
}

.pbe-prof-photo {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  object-position: center 30%;
  border: 1px solid rgba(157, 131, 255, .3);
  border-radius: 16px;
}

/* ════════════════════════════════════════════════════════════
   14. RESULT STEP — pbe_potential ("Your playing-by-ear ability")
   Moved out of templates/funnel/steps/pbe_potential.html.
   All vars scoped to .pbe-pot.
   ════════════════════════════════════════════════════════════ */
.pbe-pot {
  --po-card: #171228;
  --po-line: #2a2140;
  --po-ink: #f4f1fb;
  --po-dim: #a99fc7;
  --po-faint: #7d7399;
  --po-green: #34d399;
  --po-red: #f87171;
}

.pbe-pot-card {
  background: var(--po-card);
  border: 1px solid var(--po-line);
  border-radius: 18px;
  padding: 22px 18px 18px;
}

.pbe-pot-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 14px;
}

.pbe-pot-wrap {
  position: relative;
  width: 100%;
}

.pbe-pot-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.pbe-pot-line {
  fill: none;
  stroke: url(#pbePotLine);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  /* pathLength="1" normalises */
  animation: pbePotDraw 1.6s cubic-bezier(.4, 0, .2, 1) .25s forwards;
}

@keyframes pbePotDraw {
  to {
    stroke-dashoffset: 0
  }
}

.pbe-pot-fill {
  opacity: 0;
  animation: pbePotFill .8s ease 1.35s forwards;
}

@keyframes pbePotFill {
  to {
    opacity: 1
  }
}

.pbe-pot-dot {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: pbePotPop .45s cubic-bezier(.34, 1.56, .64, 1) forwards;
}

@keyframes pbePotPop {
  from {
    transform: scale(0)
  }

  to {
    transform: scale(1);
    opacity: 1
  }
}

.pbe-pot-pill {
  position: absolute;
  transform: translate(-50%, -115%);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  animation: pbePotPillIn .5s ease forwards;
}

.pbe-pot-pill::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
}

.pbe-pot-pill.today {
  background: var(--po-red);
  color: #fff;
}

.pbe-pot-pill.today::after {
  border-top-color: var(--po-red);
}

.pbe-pot-pill.goal {
  background: var(--po-green);
  color: #06281c;
}

.pbe-pot-pill.goal::after {
  border-top-color: var(--po-green);
}

@keyframes pbePotPillIn {
  to {
    opacity: 1
  }
}

.pbe-pot-foot {
  margin-top: 16px;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--po-ink);
}

.pbe-pot-foot .g {
  color: var(--po-green);
}

.pbe-pot-note {
  margin-top: 10px;
  font-size: 11px;
  color: var(--po-faint);
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════
   15. RESULT STEP — pbe_transformation (Now vs Goal cards)
   Moved out of templates/funnel/steps/pbe_transformation.html.
   All vars scoped to .pbe-tf.
   ════════════════════════════════════════════════════════════ */
.pbe-tf {
  --tf-card: #171228;
  --tf-line: #2a2140;
  --tf-ink: #f4f1fb;
  --tf-dim: #a99fc7;
  --tf-faint: #7d7399;
  --tf-green: #34d399;
  --tf-red: #f87171;
}

.pbe-tf-head {
  text-align: center;
  margin-bottom: 16px;
}

.pbe-tf-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--tf-ink);
  margin: 0 0 6px;
  line-height: 1.2;
}

.pbe-tf-sub {
  font-size: 14px;
  color: var(--tf-dim);
  margin: 0;
  line-height: 1.45;
}

.pbe-tcards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pbe-tcard {
  background: var(--tf-card);
  border: 1px solid var(--tf-line);
  border-radius: 16px;
  overflow: hidden;
}

.pbe-tcard-head {
  padding: 11px 14px;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
}

.pbe-tcard.now .pbe-tcard-head {
  background: linear-gradient(135deg, #3a2230, #2a1a26);
}

.pbe-tcard.goal .pbe-tcard-head {
  background: linear-gradient(135deg, #16402f, #12352a);
}

.pbe-tcard-body {
  padding: 13px 14px 16px;
}

.pbe-trow {
  margin-bottom: 13px;
}

.pbe-trow:last-child {
  margin-bottom: 0;
}

.pbe-trow-label {
  font-size: 11px;
  color: var(--tf-faint);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.pbe-trow-val {
  font-size: 14px;
  font-weight: 700;
  margin: 2px 0 6px;
}

.pbe-tcard.now .pbe-trow-val {
  color: #f3a9a0;
}

.pbe-tcard.goal .pbe-trow-val {
  color: #7fe3bf;
}

.pbe-bar {
  height: 7px;
  border-radius: 999px;
  background: var(--tf-line);
  overflow: hidden;
}

.pbe-bar-fill {
  height: 100%;
  border-radius: 999px;
  width: 0;
  animation: pbeBar 1.1s cubic-bezier(.22, 1, .36, 1) .25s both;
}

@keyframes pbeBar {
  from {
    width: 0
  }

  to {
    width: var(--w)
  }
}

.pbe-tcard.now .pbe-bar-fill {
  background: var(--tf-red);
}

.pbe-tcard.goal .pbe-bar-fill {
  background: var(--tf-green);
}

#pbe-piano-wrap{
      width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (max-width: 767px) {

  .step-pbe-question .pbe-agree-container{
    padding: 0px;
  }

  .step-pbe-module .eiq-answer-btn{
    min-width: unset;
  }

}
