#root [data-testid="stage-conversation"] {
  position: relative;
  isolation: isolate;
}

#root [data-testid="stage-conversation"]::before {
  content: "π   ∑   ∞   √   ×   ÷";
  position: absolute;
  inset: 12% 4% auto;
  z-index: -1;
  color: rgba(185, 122, 54, 0.13);
  font: 700 clamp(2.5rem, 8vw, 6rem)/1 Georgia, serif;
  letter-spacing: 0.22em;
  text-align: center;
  pointer-events: none;
  animation: km-symbol-drift 12s ease-in-out infinite alternate;
}

#root [data-testid="text-scene-setting"] {
  padding: 14px 18px !important;
  border: 1px solid rgba(185, 122, 54, 0.2);
  border-left: 3px solid rgba(185, 122, 54, 0.65) !important;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 8px 24px rgba(87, 62, 33, 0.06);
  color: #514238 !important;
  font-size: clamp(18px, 1.6vw, 21px) !important;
  animation: km-scene-arrive 650ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

#root [data-testid^="beat-"] > div:first-child > div {
  width: clamp(64px, 7vw, 84px) !important;
  height: clamp(64px, 7vw, 84px) !important;
  flex: 0 0 auto;
  animation: km-avatar-pop 650ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

#root [data-testid^="beat-"] img[alt] {
  display: block;
  border-radius: 50%;
  object-fit: cover;
  animation: km-avatar-float 3.2s ease-in-out infinite;
}

#root [data-testid^="beat-"] > div:nth-child(2) {
  position: relative;
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(54, 73, 63, 0.12);
  animation: km-bubble-arrive 480ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

#root [data-testid^="beat-"] > div:nth-child(2) > div:first-child {
  color: #34494a !important;
  font-size: 13px !important;
  font-weight: 700;
}

#root [data-testid^="beat-"] > div:nth-child(2) > div:nth-child(2) {
  color: #263638 !important;
  font-size: clamp(17px, 1.6vw, 20px) !important;
  line-height: 1.65;
}

#root a[data-testid^="tile-topic-"] {
  animation: km-topic-arrive 550ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: box-shadow 220ms ease, filter 220ms ease;
}

#root a[data-testid^="tile-topic-"] > div:first-of-type > div:first-child {
  filter: brightness(0.78) saturate(1.2);
  font-size: 13px !important;
  font-weight: 800;
}

#root a[data-testid^="tile-topic-"] > h3 {
  color: #3e3027 !important;
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(20px, 1.6vw, 23px) !important;
  font-weight: 600;
  line-height: 1.35 !important;
}

#root a[data-testid^="tile-topic-"] > div:last-of-type > div:first-child {
  color: #554a41 !important;
  font-size: clamp(12px, 1vw, 14px) !important;
  font-weight: 600;
  letter-spacing: 0.045em !important;
  line-height: 1.45;
}

#root a[data-testid^="tile-topic-"]:hover {
  box-shadow: 0 16px 34px rgba(117, 82, 37, 0.16);
  filter: saturate(1.12);
}

#root [data-testid^="option-"]:not(:disabled) {
  color: #352d26 !important;
}

#root [data-testid^="option-"] {
  font-size: clamp(17px, 1.4vw, 19px) !important;
  animation: km-option-arrive 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: box-shadow 180ms ease, filter 180ms ease;
}

#root [data-testid="text-question"] {
  color: #33291f !important;
  font-size: clamp(25px, 2.2vw, 30px) !important;
  line-height: 1.35 !important;
}

#root [data-testid^="option-"]:not(:disabled):hover {
  box-shadow: 0 8px 22px rgba(117, 82, 37, 0.12);
  filter: saturate(1.12);
}

#root [data-testid="button-advance-conversation"],
#root [data-testid="button-ready-for-quiz"] {
  transition: box-shadow 180ms ease, filter 180ms ease;
}

#root [data-testid="button-advance-conversation"]:hover,
#root [data-testid="button-ready-for-quiz"]:hover {
  box-shadow: 0 10px 24px rgba(117, 82, 37, 0.2);
  filter: brightness(1.06);
}

@keyframes km-symbol-drift {
  from { transform: translate3d(-1%, 0, 0) rotate(-2deg); }
  to { transform: translate3d(1%, 8px, 0) rotate(2deg); }
}

@keyframes km-scene-arrive {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes km-avatar-pop {
  from { opacity: 0; transform: scale(0.82) rotate(-6deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

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

@keyframes km-bubble-arrive {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes km-topic-arrive {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes km-option-arrive {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 600px) {
  #root [data-testid^="beat-"] > div:nth-child(2) > div:nth-child(2) {
    font-size: 17px !important;
  }

  #root a[data-testid^="tile-topic-"] > h3 {
    font-size: 20px !important;
  }

  #root a[data-testid^="tile-topic-"] > div:last-of-type > div:first-child {
    font-size: 12px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #root [data-testid="stage-conversation"]::before,
  #root [data-testid="text-scene-setting"],
  #root [data-testid^="beat-"] > div:first-child > div,
  #root [data-testid^="beat-"] img[alt],
  #root [data-testid^="beat-"] > div:nth-child(2),
  #root a[data-testid^="tile-topic-"],
  #root [data-testid^="option-"] {
    animation: none;
    transition: none;
  }
}
