
/* HUMAN MAXIMUS V147 — MASTERY CONTRAST LOCK
   Accessibility rule: never place white/light text on a white/light surface.
   This is an isolated presentation-only override for the Mastery experience. */

:root{
  --mastery-ink:#ffffff;
  --mastery-muted:#d8cee0;
  --mastery-purple:#8c42c6;
  --mastery-deep:#0b0710;
  --mastery-panel:#17101f;
  --mastery-panel-2:#21122e;
  --mastery-line:rgba(226,199,255,.34);
}

/* Lock the complete runner to a dark, high-contrast visual system. */
#masteryDialog,
#masteryDialog .mastery-shell,
#masteryDialog .mastery-runner,
#masteryDialog .mastery-results{
  color:var(--mastery-ink)!important;
}

#masteryDialog .mastery-question-card,
#masteryDialog .mastery-question-card.alt{
  background:
    radial-gradient(circle at 12% 0,rgba(147,66,205,.20),transparent 34%),
    linear-gradient(145deg,var(--mastery-panel-2),var(--mastery-deep) 72%)!important;
  color:var(--mastery-ink)!important;
  border:1px solid var(--mastery-line)!important;
  box-shadow:0 24px 60px rgba(0,0,0,.72),inset 0 1px rgba(255,255,255,.07)!important;
}

/* Every primary question and label must remain readable. */
#masteryDialog .mastery-question-card h3,
#masteryDialog #masteryQuestion,
#masteryDialog .mastery-guide strong,
#masteryDialog .mastery-coach-head strong,
#masteryDialog .mastery-coaching p,
#masteryDialog .mastery-coaching,
#masteryDialog .mastery-verdict{
  color:#fff!important;
  text-shadow:0 2px 10px rgba(0,0,0,.42);
}

#masteryDialog .mastery-guide small,
#masteryDialog .mastery-coach-head small{
  color:#d5a6ff!important;
}

/* Answer choices: dark purple/black surfaces with white text. */
#masteryDialog .mastery-answer,
#masteryDialog .mastery-question-card.alt .mastery-answer{
  background:linear-gradient(180deg,#20142b,#110b17)!important;
  color:#fff!important;
  border:1px solid rgba(226,199,255,.30)!important;
  box-shadow:inset 0 1px rgba(255,255,255,.055),0 8px 18px rgba(0,0,0,.22)!important;
}

#masteryDialog .mastery-answer:hover,
#masteryDialog .mastery-answer:focus-visible{
  background:linear-gradient(180deg,#351b49,#170d20)!important;
  border-color:#d9b8ff!important;
  color:#fff!important;
  box-shadow:0 0 0 3px rgba(178,102,235,.15),0 12px 26px rgba(0,0,0,.34)!important;
}

#masteryDialog .mastery-answer > span{
  background:linear-gradient(180deg,#954dd0,#59227e)!important;
  color:#fff!important;
  border:1px solid rgba(245,231,255,.48)!important;
}

#masteryDialog .mastery-answer.correct{
  background:linear-gradient(180deg,#17452e,#0b2418)!important;
  border-color:#92efbd!important;
  color:#fff!important;
}

#masteryDialog .mastery-answer.wrong{
  background:linear-gradient(180deg,#55202b,#2c1017)!important;
  border-color:#ff9eae!important;
  color:#fff!important;
}

#masteryDialog .mastery-answer:disabled{
  opacity:1!important;
  color:#fff!important;
}

/* Top controls: no pale or white button faces. */
#masteryDialog .mastery-runner-top button,
#masteryDialog .mastery-audio-tools button,
#masteryDialog .mastery-audio-tools select,
#masteryDialog #masteryBack,
#masteryDialog #masteryVoicePreview,
#masteryDialog #masteryVoiceToggle{
  background:linear-gradient(180deg,#1d1326,#0b0710)!important;
  color:#fff!important;
  border:1px solid rgba(226,199,255,.30)!important;
  box-shadow:inset 0 1px rgba(255,255,255,.06)!important;
}

#masteryDialog .mastery-audio-tools select option{
  background:#0b0710!important;
  color:#fff!important;
}

/* Coaching panel and its actions. */
#masteryDialog .mastery-coaching{
  background:linear-gradient(145deg,#180f20,#09070d)!important;
  border:1px solid rgba(226,199,255,.30)!important;
}

#masteryDialog .mastery-coaching-actions button,
#masteryDialog #masteryReplayCoaching,
#masteryDialog #masteryNext{
  background:linear-gradient(180deg,#7d38b4,#36134f)!important;
  color:#fff!important;
  border:1px solid #d9b8ff!important;
}

/* Dashboard, results, review and completion controls. */
#masteryDialog .mastery-check-card,
#masteryDialog .mastery-results,
#masteryDialog .mastery-review,
#masteryDialog .mastery-review-item,
#masteryDialog .mastery-wisdom-grid article,
#masteryDialog .mastery-guide-message,
#masteryDialog .mastery-journey-result,
#masteryDialog .mastery-next-card,
#masteryDialog .mastery-takeaway{
  color:#fff!important;
}

#masteryDialog .mastery-start,
#masteryDialog .mastery-result-actions button,
#masteryDialog .mastery-result-actions-final button,
#masteryDialog .mastery-next-card button,
#masteryDialog .mastery-takeaway button,
#masteryDialog .mastery-achievement-strip button{
  background:linear-gradient(180deg,#7834ad,#35124e)!important;
  color:#fff!important;
  border:1px solid #d9b8ff!important;
}

/* Explicitly prevent browser/default white button rendering. */
#masteryDialog button{
  -webkit-appearance:none;
  appearance:none;
}

#masteryDialog button:not(.mastery-close):not(.mastery-answer){
  color:#fff!important;
}

/* Supporting copy remains bright enough without competing with headings. */
#masteryDialog p,
#masteryDialog .mastery-next-reason,
#masteryDialog .mastery-check-card p,
#masteryDialog .mastery-journey-result p,
#masteryDialog .mastery-next-card p,
#masteryDialog .mastery-wisdom-grid p,
#masteryDialog .mastery-apply li{
  color:var(--mastery-muted)!important;
}

/* Mobile keeps the same contrast rules and comfortable touch targets. */
@media(max-width:760px){
  #masteryDialog .mastery-question-card,
  #masteryDialog .mastery-question-card.alt{
    padding:18px 14px!important;
  }

  #masteryDialog .mastery-answer{
    min-height:58px!important;
    padding:12px!important;
  }

  #masteryDialog .mastery-audio-tools button,
  #masteryDialog .mastery-audio-tools select,
  #masteryDialog #masteryBack{
    min-height:44px!important;
  }
}
