/* Keep the welcome movie-like, using cached artwork and CSS rather than video. */
.intro-orbit { display: grid; }
.intro-orbit .world-icon { width: 68%; height: 68%; }
.intro-sun,
.intro-spark { display: block; }
.intro-raqi {
  left: 50%;
  translate: -50% 0;
  transform: none;
  animation: introRaqi 900ms 150ms both, raqiSway 3.8s 1100ms ease-in-out infinite;
}
.intro-orbit {
  animation: introFeature 700ms both, introFloat 3s 1000ms ease-in-out infinite;
}
.orbit-arab { animation-delay: 200ms, 1200ms; }
.orbit-pray { animation-delay: 400ms, 1400ms; }
@keyframes introFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
}

/* The old fixed popup's -50% translate was inherited by a full-stage overlay,
   moving the success scene offscreen. Keep it centered in its own stage. */
.lesson-success {
  inset: 0;
  width: 100%;
  height: 100%;
  translate: none;
  transform: none;
  justify-content: center;
  padding: 12px;
  border: 0;
  border-radius: 30px;
  box-shadow: none;
  background: #fff6dced;
  animation: successPopup 1100ms both;
}
.lesson-success .success-scene {
  position: relative;
  left: auto;
  width: min(190px, 40vh);
  height: min(190px, 40vh);
  flex: 0 0 auto;
}
.lesson-success strong {
  font-size: clamp(24px, 4vw, 34px);
  color: #517149;
}
.lesson-success small { color: #88703e; }
.flashcard.card-flow-out,
.flashcard.card-flow-out::after { animation-delay: 700ms; }

/* Percentage-based artwork stays inside small result panels too. */
.success-scene .success-raqi {
  inset: auto;
  bottom: 4%;
  left: 50%;
  translate: -50% 0;
  width: 78%;
  height: 84%;
  animation: raqiCheer 760ms both, raqiSway 3s 850ms ease-in-out infinite;
}
.success-star {
  width: 25%;
  height: 25%;
  font-size: inherit;
}
.success-star .game-icon { width: 100%; height: 100%; }
.star-left { left: 0; top: 37%; }
.star-right { right: 0; top: 25%; }
.star-top { left: 38%; top: 0; }
.success-ripple { width: 70%; height: 12%; bottom: 0; }

.answer-feedback {
  top: auto;
  bottom: calc(var(--dock) + 12px);
  max-height: none;
  padding: 9px 16px 9px 9px;
  border-radius: 999px;
  border: 3px solid #77b657;
  background: #f6ffdf;
}
.answer-feedback img {
  width: 48px;
  height: 54px;
  animation: raqiCheer 740ms both;
}
.answer-feedback strong { font-size: 14px; }
.answer-feedback[data-result="correct"] .game-icon {
  animation: rewardPop 650ms both;
}
.race-result-art { animation: rewardPop 800ms both; }
.race-result-art > .world-icon {
  animation: rewardPop 800ms 150ms both, raqiSway 3s 1s ease-in-out infinite;
}
@media (max-width: 700px) {
  .intro-orbit { width: 62px; height: 62px; }
  .orbit-book { top: 34%; left: 4%; }
  .orbit-arab { top: 14%; right: 4%; }
  .orbit-pray { bottom: 15%; right: 8%; }
}
@media (max-height: 599px) and (min-width: 480px) {
  .welcome-dialog[open] {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 8px;
    max-height: calc(100dvh - 20px);
  }
  .intro-scene { height: 74vh; min-height: 0; }
  .intro-copy { padding: 30px 18px 12px 0; text-align: left; }
  .intro-copy h1 { font-size: 27px; margin: 6px 0; }
  .intro-copy p { font-size: 10px; margin: 7px 0; }
  .intro-logo { font-size: 23px; }
  .intro-eyebrow { font-size: 6px; margin: 6px 0; }
  .intro-features, .intro-footnote { display: none; }
  .intro-orbit { width: 48px; height: 48px; }
  .orbit-book { top: 35%; left: 2%; }
  .orbit-arab { top: 12%; right: 2%; }
  .orbit-pray { bottom: 22%; right: 1%; }
  .answer-feedback { padding: 5px 12px 5px 6px; }
  .answer-feedback img { width: 32px; height: 36px; }
  .answer-feedback strong { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .lesson-success,
  .intro-raqi,
  .intro-orbit,
  .success-scene .success-raqi,
  .race-result-art,
  .race-result-art > .world-icon,
  .answer-feedback img,
  .answer-feedback .game-icon { animation: none; }
}
