/* ==========================================================================
   MilleRace - Final Result Page CSS (Aligned with Figma Reference & Revised Specs)
   ========================================================================== */

#screen-result {
  background-color: #16141C;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  min-height: 100vh;
  font-family: var(--font-body), 'Bona Nova', Georgia, serif;
  scroll-behavior: smooth;
  position: relative;
}

.result-page-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-sizing: border-box;
}

/* 2. HERO SHOWCASE SECTION & 1/4 PURPLE RECTANGLE ANCHORED AT BOTTOM */
.result-showcase-section {
  width: 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 40px 24px 0 24px;
  box-sizing: border-box;
  min-height: 520px;
}

.result-purple-band {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 65%;
  background: #854EB4;
  /* box-shadow: inset 0 6px 20px rgba(0, 0, 0, 0.25), 0 10px 30px rgba(0, 0, 0, 0.4); */
  z-index: 1;
}

.result-showcase-container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(24px, 4vw, 50px);
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}

/* Result Card Column & Congratulations Text */
.result-card-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 640px;
  width: 100%;
  gap: 18px;
  z-index: 2;
}

.result-congrats-text {
  font-family: var(--font-title), 'Cinzel', serif;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  font-weight: 700;
  color: #FFFFFF;
  text-align: center;
  line-height: 1.4;
  letter-spacing: 1px;
  margin-bottom: 50px;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
}

.result-congrats-rank {
  color: var(--color-yellow);
  font-weight: 700;
  text-shadow: 0 0 16px rgba(243, 205, 80, 0.85);
}

/* Scalloped Ivory Parchment Card (result-card.svg) */
.result-parchment-card {
  background-image: url('../assets/images/ui/result/result-card.svg');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  width: 100%;
  max-width: 640px;
  min-height: 380px;
  padding: 50px 44px 30px 44px;
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.5));
}

/* Gold Ribbon Header Badge (Result-with-name.svg) */
.result-name-banner-wrapper {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(280px, 35vw, 440px);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-name-banner-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
  z-index: 1;
}

.result-name-banner-text {
  position: relative;
  z-index: 2;
  font-family: var(--font-title), 'Cinzel', serif;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  font-weight: 700;
  color: #16141C;
  letter-spacing: 1.5px;
  text-align: center;
  white-space: nowrap;
}

/* Separate Distinct Level Badges (PISA & CEFR) */
.result-levels-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.result-level-pill {
  font-family: var(--font-body), 'Bona Nova', serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pisa-pill {
  background: #16141C;
  color: var(--color-yellow);
  border: 1px solid var(--color-yellow);
}

.cefr-pill {
  background: #854EB4;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Character Quote Callout */
.result-char-quote {
  font-family: var(--font-body), 'Bona Nova', serif;
  font-style: italic;
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  line-height: 1.5;
  color: #4A1D75;
  margin: 0 0 10px 0;
  padding: 8px 12px;
  border-left: 3.5px solid #854EB4;
  background: rgba(133, 78, 180, 0.08);
  border-radius: 0 8px 8px 0;
  font-weight: 600;
}

/* Character Bio in Serif */
.result-parchment-bio {
  font-family: var(--font-body), 'Bona Nova', serif;
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  line-height: 1.6;
  color: #16141C;
  font-weight: 400;
  margin: 0 0 14px 0;
  user-select: text;
}

/* Share Result Button */
.result-share-btn {
  align-self: flex-end;
  background: #F3CD50;
  color: #16141C;
  border: none;
  border-radius: 20px;
  padding: 8px 22px;
  font-family: var(--font-title), 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  transition: var(--transition-fast);
  margin-top: 8px;
  margin-right: 25px;
}

.result-share-btn:hover {
  background: #FFFFFF;
  color: var(--color-dark-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-yellow);
}

.result-share-btn:active {
  transform: scale(0.96);
}

/* Full Size Transparent Avatar Hero (at least 50% taller than result card) */
.result-character-hero {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
}

.result-hero-avatar-img {
  height: 580px;
  max-height: 620px;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.65));
}

/* 3. MIL SCORE & ANIMATED PROGRESS SECTION */
.result-score-section {
  width: 100%;
  max-width: 1100px;
  padding: 44px 24px 20px 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.result-score-header-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  flex-wrap: wrap;
  gap: 16px;
}

.result-score-titles {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-score-title {
  font-family: var(--font-title), 'Cinzel', serif;
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
}

.result-score-description {
  font-family: var(--font-body), 'Bona Nova', serif;
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
  font-weight: 400;
}

.result-score-badge-box {
  display: flex;
  align-items: center;
}

.result-score-percent {
  font-family: var(--font-title), 'Cinzel', serif;
  font-size: clamp(3.2rem, 6vw, 4.8rem);
  font-weight: 700;
  color: var(--color-yellow);
  line-height: 1;
  text-shadow: 0 0 25px rgba(243, 205, 80, 0.75);
}

/* Progress Bar & Stage Breakdown */
.result-progress-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.result-progress-track {
  width: 100%;
  height: 34px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  border: 1.5px solid rgba(243, 205, 80, 0.35);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
}

.result-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #F3CD50 0%, #FFE58F 65%, #FFFFFF 100%);
  border-radius: 28px;
  transition: width 1.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 20px rgba(243, 205, 80, 0.9);
  width: 0%;
}

/* Stage Breakdown Milestones */
.result-stage-milestones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  width: 100%;
}

.stage-milestone {
  background: rgba(22, 20, 28, 0.6);
  border: 1px solid rgba(243, 205, 80, 0.25);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.milestone-label {
  font-family: var(--font-body), 'Bona Nova', serif;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

.milestone-score {
  font-family: var(--font-title), 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-yellow);
}

/* Educational Blurb & Glowing Dots Row */
.result-blurb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-top: 10px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 22px 26px;
}

.result-blurb-content {
  flex: 1;
  min-width: 280px;
}

.result-blurb-heading {
  font-family: var(--font-body), 'Bona Nova', serif;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  font-weight: 600;
  line-height: 1.5;
  color: #FFFFFF;
  margin: 0 0 10px 0;
}

.result-misinfo-list {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-misinfo-list li {
  font-family: var(--font-body), 'Bona Nova', serif;
  font-size: 0.95rem;
  color: #D9D9D9;
  line-height: 1.5;
}

.result-misinfo-list a {
  color: var(--color-yellow);
  text-decoration: underline;
  word-break: break-all;
  transition: var(--transition-fast);
}

.result-misinfo-list a:hover {
  color: #FFFFFF;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.result-glowing-dots-img {
  width: 96px;
  height: auto;
  flex-shrink: 0;
}

/* 4. RECOMMENDATIONS & TOOLKIT (NO CONTAINER BACKGROUND) */
.result-recommendations-section {
  width: 100%;
  max-width: 1100px;
  padding: 40px 24px 30px 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.rec-section-title {
  font-family: var(--font-title), 'Cinzel', serif;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  color: var(--color-yellow);
  text-align: center;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
}

.rec-card {
  background: #16141C;
  border: 1.5px solid rgba(243, 205, 80, 0.4);
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.rec-card:hover {
  border-color: var(--color-yellow);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow-yellow);
}

.rec-card-header {
  font-family: var(--font-title), 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-yellow);
  display: flex;
  align-items: center;
  gap: 10px;
}

.rec-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.rec-list li {
  font-family: var(--font-body), 'Bona Nova', serif;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #E2E8F0;
}

.rec-list a {
  color: var(--color-yellow);
  text-decoration: underline;
  transition: var(--transition-fast);
  font-weight: 600;
}

.rec-list a:hover {
  color: #FFFFFF;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* Action Buttons */
.result-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.result-btn-gold,
.result-btn-purple {
  font-family: var(--font-title), 'Cinzel', serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 34px;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

.result-btn-gold {
  background: var(--color-yellow);
  color: #16141C;
  border: none;
}

.result-btn-gold:hover {
  background: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-yellow);
}

.result-btn-purple {
  background: #16141C;
  color: #FFFFFF;
  border: 1.5px solid var(--color-yellow);
}

.result-btn-purple:hover {
  background: var(--color-yellow);
  color: #16141C;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-yellow);
}

/* Responsive Styles */
@media (max-width: 900px) {
  .result-showcase-container {
    flex-direction: column-reverse;
    align-items: center;
  }

  .result-parchment-card {
    padding: 44px 28px 24px 28px;
  }

  .result-name-banner-wrapper {
    width: 90%;
  }

  .result-hero-avatar-img {
    height: 400px;
    max-height: 440px;
  }
}

@media (max-width: 600px) {
  .result-name-banner-wrapper {
    width: 95%;
    top: -20px;
    height: 44px;
  }

  .result-name-banner-text {
    font-size: 0.9rem;
  }

  .result-score-percent {
    font-size: 3rem;
  }

  .result-hero-avatar-img {
    height: 320px;
    max-height: 360px;
  }
}