/* =========================================================
   Constipation Test — iPad webapp
   Vanilla CSS · designed for landscape iPad (1024 × 768)
   ========================================================= */

@font-face {
  font-family: "Gotham Rounded";
  src: url("../fonts/GothamRnd-Book.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gotham Rounded";
  src: url("../fonts/GothamRnd-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Gotham Rounded";
  src: url("../fonts/GothamRnd-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --purple:        #3d3f95;
  --purple-deep:   #2f3179;
  --purple-soft:   #5b5dad;
  --orange:        #ee7a3f;
  --orange-soft:   #f1a283;
  --green:         #8ec842;
  --green-deep:    #71a832;
  --green-bg:      #9ed428;
  --cyan:          #4abad0;
  --white:         #ffffff;
  --offwhite:      #f7f8f5;
  --text-dark:     #1a3f7e;
  --text-on-card:  #2f3179;

  --bar-depth:     10px;

  --footer-h:      90px;
  --pad:           clamp(20px, 3vw, 40px);
  --radius-card:   18px;
  --radius-pill:   999px;

  --t-fade:        420ms;
  --t-pop:         520ms;
  --t-slow:        700ms;
}

/* ---------- reset ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: "Gotham Rounded", "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  color: var(--white);
  background: var(--purple);
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
sub, sup { font-size: 60%; }
sup { vertical-align: super; }
sub { vertical-align: sub; }

/* ---------- stage / screen layering ---------- */
.stage {
  position: relative;
  height: 100vh;        /* fallback */
  height: 100svh;       /* extra fallback */
  height: 100dvh;       /* the one that fixes Top layout */

  width: 100vw;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  padding: var(--pad) var(--pad) calc(var(--pad) + 70px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: var(--purple);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--t-fade) ease, transform var(--t-fade) ease, visibility 0s linear var(--t-fade);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity var(--t-fade) ease, transform var(--t-fade) ease, visibility 0s;
}

.screen-answer { background: var(--green-bg); color: var(--text-on-card); }
.screen-end    { background: var(--purple); align-items: center; justify-content: center; }

/* ============================================================
   ANIMATION PRIMITIVES
   ============================================================ */
.anim-fade {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--t-fade) ease, transform var(--t-fade) ease;
}
.anim-fade.is-in {
  opacity: 1;
  transform: translateY(0);
}

.anim-pop {
  opacity: 0;
  transform: scale(.35);
  transition: opacity var(--t-pop) cubic-bezier(.2, .9, .3, 1.5),
              transform var(--t-pop) cubic-bezier(.2, .9, .3, 1.5);
  will-change: transform, opacity;
}
.anim-pop.is-in {
  opacity: 1;
  transform: scale(1);
}

/* typewriter caret */
.typewriter::after {
  content: "▌";
  display: inline-block;
  margin-left: 2px;
  animation: blink 800ms steps(2, start) infinite;
  opacity: .85;
}
.typewriter.is-done::after { display: none; }

@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   INTRO
   ============================================================ */
.screen-intro { background: var(--purple); align-items: center; justify-content: center; }
.intro-tap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.intro-hint {
  font-size: 22px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  animation: pulseHint 1.6s ease-in-out infinite;
}
@keyframes pulseHint { 50% { opacity: .35; } }

/* ============================================================
   TITLE
   ============================================================ */
.screen-title { align-items: center; justify-content: center; }
.title-pill {
  background: var(--orange);
  color: var(--white);
  padding: 28px 80px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: clamp(36px, 6vw, 78px);
  letter-spacing: .02em;
  text-align: center;
  box-shadow: 0 6px 0 rgba(0,0,0,.06);
  margin-top: auto;
}
.legal-bottom {
  position: absolute;
  bottom: calc(var(--footer-h) + 20px);
  left: var(--pad);
  font-size: 11px;
  color: rgba(255,255,255,.55);
  letter-spacing: .02em;
}

/* ============================================================
   QUESTION SCREENS
   ============================================================ */
.q-head {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.q-num {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 0 0 4px rgba(142,200,66,.25);
}
.q-text {
  font-size: clamp(18px, 1.9vw, 24px);
  line-height: 1.3;
  font-weight: 700;
  margin: 0;
  flex: 1;
  min-height: 1.3em;
}

.q-instruction {
  background: var(--orange);
  color: var(--white);
  padding: 22px 28px;
  border-radius: 28px;
  text-align: center;
  font-weight: 600;
  margin: 30px auto;
  max-width: 640px;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.4;
}

/* options grid 2×2 */
.options-grid {
  display: grid;
  gap: 16px;
  margin-top: 8px;
}
.options-2x2 {
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: auto;
}

/* option card */
.option-card {
  position: relative;
  background: var(--white);
  color: var(--text-on-card);
  border-radius: var(--radius-card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 2px 0 rgba(0,0,0,.06);
}
.option-card:active { transform: scale(.98); }

/* selected state on the parent label when checkbox is checked */
.option-card:has(input:checked) {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  background: #fff7f1;
}

.opt-letter {
  position: absolute;
  top: 0px;
  left: 0px;
  width: 38px;
  height: 38px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--white);
  font-size: 18px;
  z-index: 2;
  border-top-left-radius: 1rem;
}
.opt-letter.green { background: var(--green); color: white }

.opt-img {
  border-radius: 12px;
  height: 130px;
  /*background: #e8eef4;*/
  overflow: hidden;
  position: relative;
}
/* fill the slot whether it's a static <img> or an inline <svg> */
.opt-img > img,
.opt-img > svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* ---- example animation for option B (inline SVG) ---- */
@keyframes opt-pulse {
  0%, 100% { transform: scale(1);   opacity: .85; }
  50%      { transform: scale(1.12); opacity: 1;  }
}
@keyframes opt-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.opt-svg-anxiety .pulse  { transform-origin: center; animation: opt-pulse 1.6s ease-in-out infinite; }
.opt-svg-anxiety .float  { transform-origin: center; animation: opt-float 2.2s ease-in-out infinite; }

.opt-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 4px 4px 8px;
}
.opt-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--orange);
}
.opt-text {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
}

/* ---- Option A: full-card SVG cover ---- */
.opt-img.a1-full { position:absolute; inset:0; border-radius:var(--radius-card); z-index:0; height: 100% !important}
.option-card:has(.opt-img.a1-full) { min-height:168px; }
.option-card:has(.opt-img.a1-full) .opt-row { position:relative; z-index:1; margin-top:auto; }

.opt-img.a1-full img{
  object-fit: cover !important;
  max-height: 100% !important;
  height: 100% !important;
}


/* ---- Option C: 3-image sequential reveal ---- */
.opt-img.c3-stage { display:flex; flex-direction:row; gap:1px; }
.opt-img.c3-stage img { position:static; flex:1; min-width:0; height:100%; object-fit:contain; opacity:0; object-position: bottom;}
.opt-img.c3-stage img:nth-child(3) { max-height:130px; align-self:flex-end; }
.option-card.is-in .opt-img.c3-stage img { animation:c3fade .45s ease forwards; animation-delay:.45s; }
.option-card.is-in .opt-img.c3-stage img:nth-child(2) { animation-delay:.75s; }
.option-card.is-in .opt-img.c3-stage img:nth-child(3) { animation-delay:1.05s; }
@keyframes c3fade { to { opacity:1; } }

/* ---- Option D: 3-image sequential reveal ---- */
.opt-img.d4-stage { display:flex; flex-direction:row; gap:1px; align-items:flex-end; }
.opt-img.d4-stage img { position:static; flex:1; min-width:0; height:100%; object-fit:contain; opacity:0; }
.option-card.is-in .opt-img.d4-stage img { animation:c3fade .45s ease forwards; animation-delay:.45s;object-position: bottom; }
.option-card.is-in .opt-img.d4-stage img:nth-child(2) { animation-delay:.75s; }
.option-card.is-in .opt-img.d4-stage img:nth-child(3) { animation-delay:1.05s; }

/* flat option card (q3) */
.option-card.flat .opt-row { padding: 16px 8px 8px;}
.option-card.flat { padding: 18px 14px 14px; padding-top: 2.1rem }

/* legal references */
.legal-refs {
  font-size: 10px;
  line-height: 1.45;
  color: white;
  margin: 18px 0 4px;
  word-spacing: 1px;
}
.screen-answer .legal-refs { color:white; }

/* utility text colours */
.orange { color: var(--orange); }
.cyan { color: var(--cyan); }
.green { color: var(--green); }
.white { color: var(--white); }

/* ============================================================
   RANK QUESTION (Q2)
   ============================================================ */
.rank-wrap {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2fr;
  gap: 30px;
  align-items: center;
  margin-top: 20px;
  flex: 1;
}

.rank-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.rank-options li {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-end;
  font-weight: 700;
  font-size: 16px;
}

.rank-ball {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 800;
  font-size: 16px;
  cursor: grab;
  user-select: none;
  flex: 0 0 auto;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.rank-ball.green { background: var(--green); box-shadow: 0 0 0 3px rgba(142,200,66,.25); }
.rank-ball:active { cursor: grabbing; transform: scale(1.1); }
.rank-ball.is-placed { opacity: .35; pointer-events: none; }
.rank-ball.is-selected { box-shadow: 0 0 0 5px rgba(238,122,63,.55); }

.rank-board {
  background: var(--white);
  color: var(--text-on-card);
  border-radius: var(--radius-card);
  padding: 0 0 18px 0;
  position: relative;

}
.rank-instruction {
  background: var(--orange);
  color: var(--white);
  border-radius: 14px 14px 0 0;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 16px;
}

.rank-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 14px;
  height: 220px;
  padding: 0 12px;
}
.rank-bar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.bar-fill {
  width: 70%;
  border-radius: 0;
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform 700ms cubic-bezier(.2,.8,.3,1.1);
  position: relative;
}
.bar-fill::before {
  content: '';
  position: absolute;
  top: 0;
  right: 100%;
  width: var(--bar-depth);
  height: 100%;
  clip-path: polygon(100% 0%, 0% var(--bar-depth), 0% 100%, 100% 100%);
}
.is-bars-in .bar-fill { transform: scaleY(1); }

.bar-1 .bar-fill { background: var(--orange);     height: 100%; }
.bar-2 .bar-fill { background: var(--orange-soft); height: 70%; }
.bar-3 .bar-fill { background: var(--purple-soft); height: 50%; }
.bar-4 .bar-fill { background: var(--purple-deep); height: 30%; }

.bar-1 .bar-fill:before { background: var(--orange); opacity: .3}
.bar-2 .bar-fill:before { background: var(--orange-soft); opacity: .3}
.bar-3 .bar-fill:before { background: var(--purple-soft); opacity: .3}
.bar-4 .bar-fill:before { background: var(--purple-deep); opacity: .3}

.bar-cap {
  margin-top: 6px;
  font-weight: 800;
  font-size: 22px;
}
.bar-1 .bar-cap b { color: var(--orange); }
.bar-2 .bar-cap b { color: var(--orange-soft); }
.bar-3 .bar-cap b { color: var(--purple-soft); }
.bar-4 .bar-cap b { color: var(--purple-deep); }
.bar-cap sub { font-weight: 700; font-size: 13px; color: inherit; opacity: .8; }

.rank-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 14px 12px 4px;
  margin-top: 6px;
}
.rank-slot {
  height: 50px;
  width: 50px;
  border: 2px dashed rgba(61,63,149,.45);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
  margin: 0 auto;
}
.rank-slot.is-hover {
  background: rgba(238,122,63,.15);
  border-color: var(--orange);
  transform: scale(1.05);
}
.rank-slot .rank-ball { cursor: pointer; }

/* ============================================================
   ANSWER SCREENS
   ============================================================ */
.answer-pill {
  background: var(--white);
  color: var(--green);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  padding: 8px 50px;
  border-radius: var(--radius-pill);
  margin: 0 auto 16px;
  text-align: center;
}

.answer-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.answer-card {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  color: var(--text-on-card);
  /*box-shadow: 0 2px 0 rgba(0,0,0,.05);*/
}
.answer-card.big { grid-template-columns: 1fr; }
.answer-card ul.ans-text {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.4;
}
.answer-card ul.ans-text li { margin: 4px 0; }
.ans-img {
  width: 100px;
  height: 80px;
  background: #e8eef4;
  border-radius: 10px;
}

/* answer 2 layout */
.a2-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.a2-left { display: flex; flex-direction: column; gap: 14px; }
.a2-left .answer-card {
  display: block;
  background: transparent;
}
.a2-left .answer-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--purple-deep);
}
.a2-left .answer-card ul {
  margin: 0;
  padding-left: 22px;
  font-size: 13px;
  line-height: 1.45;
}
.a2-right {
  background: transparent;
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  gap: 12px;
}
.a2-right h3 {
  font-size: 22px;
  margin: 0;
  color: var(--purple-deep);
  font-weight: 800;
}
.placeholder-pyramid { flex: 1; min-height: 240px; border-radius: 16px; }

/* answer 3 layout */
.answer-card.big h2 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 700;
  line-height: 1.3;
}
.a3-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
  font-size: 17px;
  flex-wrap: wrap;
}
.badge-orange {
  background: var(--orange);
  color: var(--white);
  padding: 8px 14px;
  border-radius: 14px;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
}
.big-percent {
  color: var(--orange);
  font-weight: 800;
  font-size: clamp(38px, 5vw, 56px);
}
.stat-text { flex: 1; min-width: 220px; font-weight: 500; }
.a3-stat-2 { margin: 4px 0 14px; font-weight: 500; }
.a3-credit { font-size: 12px; color: var(--text-on-card); opacity: .7; text-align: right; margin: 6px 0 0; }
.placeholder-people { height: 130px; border-radius: 12px; }

/* ============================================================
   END SCREEN
   ============================================================ */
.end-pill {
  background: var(--white);
  color: var(--orange);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  padding: 24px 70px;
  border-radius: var(--radius-pill);
  margin-bottom: 30px;
}
.end-status {
  margin: 0 0 28px;
  font-size: 15px;
  color: rgba(255,255,255,.7);
}

/* ============================================================
   NEXT BUTTON
   ============================================================ */
.btn-next {
  /*position: absolute;*/
  /*right: var(--pad);*/
  /*bottom: 28px;*/
  background: var(--orange);
  color: var(--white);
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  letter-spacing: .02em;
  box-shadow: 0 4px 0 rgba(0,0,0,.12);
  transition: transform 160ms ease, opacity 200ms ease;
  opacity: 0;
  pointer-events: none;

  /*//text*/
  margin-top: auto;
  width: fit-content;
  margin-left: auto;
}
.btn-next.is-in {
  opacity: 1;
  pointer-events: auto;
}
.btn-next:active { transform: translateY(1px); }
.btn-next[disabled] { opacity: .35 !important; pointer-events: none; }

.screen-end .btn-next { position: static; opacity: 1; pointer-events: auto; }

/* ============================================================
   PLACEHOLDER (image stand-ins)
   ============================================================ */
.placeholder {
  background:
    repeating-linear-gradient(45deg,
      rgba(61,63,149,.05) 0 8px,
      rgba(61,63,149,.10) 8px 16px);
  border: 1px dashed rgba(61,63,149,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(61,63,149,.55);
  font-size: 11px;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-align: center;
  padding: 6px;
}
.placeholder-label { pointer-events: none; }

.placeholder-scene {
  height: 220px;
  border-radius: 18px;
  margin: 12px 0 16px;
}

/* ============================================================
   OFFLINE BADGE
   ============================================================ */
.offline-badge {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.7);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 100;
}

/* ============================================================
   INSTALL APP BUTTON (PWA prompt)
   ============================================================ */
.install-btn {
  position: fixed;
  bottom: max(14px, env(safe-area-inset-bottom));
  right: 14px;
  background: var(--orange, #f08a3e);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  z-index: 100;
  cursor: pointer;
}
.install-btn:active { transform: translateY(1px); }
/* hide it when running as an installed PWA */
@media (display-mode: standalone), (display-mode: fullscreen) {
  .install-btn { display: none !important; }
}

/* ============================================================
   PORTRAIT / SMALL VIEWPORT TWEAKS
   ============================================================ */
@media (max-width: 820px), (orientation: portrait) {
  .options-2x2 { grid-template-columns: 1fr; }
  .rank-wrap { grid-template-columns: 1fr; }
  .a2-grid   { grid-template-columns: 1fr; }
  .opt-img   { height: 110px; }
  .rank-bars { height: 160px; }
  .q-text    { font-size: 18px; }
}

/*IMGAGE SCREEN SPECIFIC CSS*/

[data-screen="q1"]{
  .opt-img {
    background: transparent;
    height: fit-content ;
    img{

    object-fit: contain;
    height: 180px;
    }
  }
}
[data-screen="a1"] {
  .answer-card {
    grid-template-columns: 200px 1fr;
    padding: 0;
    overflow: hidden;
    align-items: stretch;
  }

  .opt-img {
    height: auto;
    border-radius: 0;
    align-self: stretch;
  }

  .opt-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .ans-text {
    padding: 16px 20px 16px 0;
  }
}
[data-screen="a2"], [data-screen="q3"], [data-screen="a3"] {
  .opt-img {
   height: fit-content;
  }
}

[data-screen="q3"]{
  .opt-img {
    height: 250px;

    img {
      height: 100%;
    }
  }
}

/*Color helpers*/
.text-white{
  color: white;
}

/* ===================================================================
   Q3 · Lottie-style animated illustration stage
   =================================================================== */

/* Stage: aspect-ratio matches cropped SVGs (1938 × 606) */
.q3-lottie-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1938 / 606;
  border-radius: 1.2rem;
  overflow: hidden;
  margin-bottom: 1.2rem;
  min-height: 180px;
}

/* SVG backgrounds — stacked, cross-fade via opacity */
.q3-lottie-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.q3-lottie-img.is-active { opacity: 1; }

.q3-lottie-player {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Overlay wrapper — hidden until activated */
.q3-ov {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.q3-ov.is-active { display: block; }

/* ── Speech bubble
   Positioned as % of the stage so they scale with the SVG.
   Left character (doctor) ≈ 35 % from left; right (patient) ≈ 72 %. */
.lb {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.55rem, 2vw, 1.1rem);
  font-weight: 800;
  color: #231e60;
  width: 13%;
  aspect-ratio: 1;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #b0abd5;
  opacity: 0;
  transform: scale(0.15);
}
.lb-doc { left: 35%; top: 3%; }
.lb-pat { left: 72%; top: 11%; }

/* Phase timing — animations reset each time the overlay is shown */
.lb-ph1 { animation: lbPop 0.42s cubic-bezier(0.34,1.56,0.64,1) 0.1s  both; }
.lb-ph2 { animation: lbPop 0.42s cubic-bezier(0.34,1.56,0.64,1) 1.35s both; }
.lb-ph3 { animation: lbPop 0.42s cubic-bezier(0.34,1.56,0.64,1) 2.4s  both; }

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

/* Animated three dots (option A doctor bubble) */
.lb-dots { display: flex; gap: 14%; align-items: center; }
.lb-dots i {
  display: block;
  width: 22%;
  aspect-ratio: 1;
  background: #534188;
  border-radius: 50%;
  animation: dotBounce 0.65s ease-in-out infinite alternate;
}
.lb-dots i:nth-child(2) { animation-delay: 0.15s; }
.lb-dots i:nth-child(3) { animation-delay: 0.30s; }

@keyframes dotBounce {
  to { transform: translateY(-38%); }
}

/* Gut / wavy content */
.lb-gut  { letter-spacing: -0.05em; font-size: 1.1em; }

/* Question mark */
.lb-qmark { font-size: 1.5em; }

/* Hand ripple — pulsing circle over patient belly area */
.lb-hand {
  position: absolute;
  left: 75%; top: 48%;
  width: 9%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid #f8a185;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.3);
}
.lb-ph2.lb-hand {
  animation:
    handRipple 0.9s ease-out 1.35s both,
    handPulse  1.1s ease-in-out 2.3s 2 alternate;
}
@keyframes handRipple {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(0.3); }
  55%  { opacity: 1; transform: translate(-50%,-50%) scale(1.25); }
  100% { opacity: 0.85; transform: translate(-50%,-50%) scale(1); }
}
@keyframes handPulse {
  to { transform: translate(-50%,-50%) scale(1.35); opacity: 0.25; }
}

/* Spiral — "beating around the bush" (option D) */
.lb-spiral {
  position: absolute;
  left: 31%; top: 26%;
  width: 11%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #534188;
  border-right-color: #534188;
  opacity: 0;
  animation: spiralDraw 1.1s ease-out 0.1s both;
}
@keyframes spiralDraw {
  0%   { opacity: 0; transform: rotate(-90deg) scale(0.2); }
  25%  { opacity: 1; }
  100% { opacity: 1; transform: rotate(270deg) scale(1); }
}

/* Line draw (option D) */
.lb-line {
  position: absolute;
  left: 31%; top: 55%;
  height: 3px;
  background: #534188;
  border-radius: 2px;
  width: 0;
  opacity: 0;
  animation: lineDraw 0.75s ease-out 1.8s both;
}
@keyframes lineDraw {
  0%   { opacity: 1; width: 0; }
  100% { opacity: 1; width: 34%; }
}