:root {
  --ink: #242347;
  --purple: #5b50d6;
  --purple-dark: #4339b7;
  --yellow: #ffd646;
  --cream: #fffaf0;
  --green: #39b978;
  --red: #ef6b67;
  --muted: #777590;
  --line: #e8e4f2;
}

* { box-sizing: border-box; }

html {
  background: var(--cream);
  overscroll-behavior-y: none;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 16%, rgba(255, 214, 70, .23) 0 90px, transparent 92px),
    radial-gradient(circle at 88% 30%, rgba(91, 80, 214, .12) 0 130px, transparent 132px),
    var(--cream);
  font-family: "Nunito", "Microsoft YaHei", "PingFang SC", sans-serif;
}

body.game-active {
  background-image:
    linear-gradient(rgba(255, 250, 240, .68), rgba(255, 250, 240, .78)),
    var(--level-background);
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.site-header {
  position: relative;
  width: min(1120px, calc(100% - 36px));
  height: 88px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.voice-status {
  position: absolute;
  top: 72px;
  right: 0;
  z-index: 5;
  max-width: 310px;
  margin: 0;
  padding: 8px 12px;
  color: #8a4d16;
  background: #fff2cf;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.voice-status:empty { display: none; }

.sound-button {
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  background: white;
  border: 2px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.voice-gender-selector {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(46, 38, 99, .08);
}

.voice-gender-selector button {
  min-height: 34px;
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: 900 12px "Nunito", sans-serif;
}

.voice-gender-selector button.active {
  color: white;
  background: var(--purple);
}

main {
  width: min(1120px, calc(100% - 36px));
  min-height: calc(100vh - 150px);
  margin: auto;
}

.screen { display: none; }
.screen.active { display: flex; }

.primary-button {
  min-height: 56px;
  padding: 0 27px;
  color: white;
  background: var(--purple);
  border: 0;
  border-radius: 17px;
  box-shadow: 0 8px 0 var(--purple-dark);
  cursor: pointer;
  font: 800 18px "Nunito", "Microsoft YaHei", "PingFang SC", sans-serif;
  transition: transform .15s, box-shadow .15s;
}

.primary-button:hover { transform: translateY(-2px); }
.primary-button:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--purple-dark); }
.primary-button:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.hidden { display: none !important; }

.level-screen {
  padding: 48px 0 80px;
  flex-direction: column;
}

.level-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: 26px;
  align-items: stretch;
  margin-bottom: 30px;
  overflow: hidden;
  background: rgba(255, 255, 255, .82);
  border: 3px solid white;
  border-radius: 34px;
  box-shadow: 0 22px 50px rgba(46, 38, 99, .11);
}

.level-hero-scene {
  min-height: 290px;
  overflow: hidden;
  border-radius: 30px;
}

.level-hero-scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.level-hero-copy {
  position: absolute;
  inset: 0 34% 0 0;
  display: flex;
  align-items: center;
  padding: clamp(26px, 4vw, 48px);
  color: white;
  background: linear-gradient(90deg, rgba(3, 23, 53, .88), rgba(3, 23, 53, .62), transparent);
}

.level-heading { max-width: 600px; }
.module-identifier { margin: 0 0 12px; }
.module-identifier span {
  display: inline-flex;
  padding: 5px 10px;
  color: #ffe6a8;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.journey-kicker {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 13px;
  color: #ffe6a8;
  font-weight: 900;
}

.journey-kicker img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

h1, h2 {
  margin: 0;
  font-family: "Baloo 2", "Microsoft YaHei", "PingFang SC", sans-serif;
  line-height: .98;
}

.level-heading h1 {
  margin-bottom: 10px;
  font-size: clamp(44px, 6vw, 68px);
  text-shadow: 0 4px 18px rgba(0, 0, 0, .22);
}

.level-heading > p:last-child {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, .88);
  font-size: 18px;
  line-height: 1.55;
}

.level-total {
  margin: 0;
  color: #ffe6a8;
  font-weight: 900;
}

.level-hero-mascot {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 290px;
  padding: 26px;
}

.level-hero-mascot img {
  width: min(92%, 230px);
  animation: mascot-bob 3.2s ease-in-out infinite;
  filter: drop-shadow(0 16px 15px rgba(0, 0, 0, .18));
}

.level-speech-bubble {
  position: absolute;
  top: 18px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 12px 18px;
  color: #0f2b5b;
  background: white;
  border: 2px solid #ffd071;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(46, 38, 99, .12);
  font: 900 20px "Baloo 2", sans-serif;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.level-card {
  min-height: 190px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: white;
  border: 3px solid var(--line);
  border-radius: 25px;
  cursor: pointer;
  text-align: center;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}

.level-card:hover,
.level-card:focus-visible {
  transform: translateY(-5px);
  border-color: var(--purple);
  box-shadow: 0 14px 28px rgba(55, 44, 120, .12);
  outline: none;
}

.level-number {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--purple);
  border-radius: 12px;
  font-weight: 900;
}

.level-icon { margin: 10px 0 4px; font-size: 36px; }
.level-card strong { font: 800 19px "Baloo 2", "Microsoft YaHei", "PingFang SC", sans-serif; }
.level-card small { color: var(--muted); font-weight: 800; }
.level-best { min-height: 20px; margin-top: 8px; color: #9b7100; font-size: 13px; font-weight: 900; }

.learning-progress-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  margin-top: 28px;
  padding: 22px;
  background: white;
  border: 3px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 18px 36px rgba(46, 38, 99, .08);
}

.progress-card-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--purple);
  border-radius: 15px;
  font-size: 25px;
}

.progress-dashboard-content h2 { font-size: 28px; }
.progress-dashboard-content p { color: var(--muted); }
.progress-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.progress-stat-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 13px; }
.dashboard-progress-track,
.progress-track { height: 12px; overflow: hidden; background: #e5e1ef; border-radius: 99px; }
.dashboard-progress-track span,
#progress-fill { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--purple), #8d80f1); border-radius: inherit; transition: width .4s; }

.game-screen {
  max-width: 780px;
  margin: 20px auto 70px;
  flex-direction: column;
}

.game-topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 25px;
  align-items: center;
  margin-bottom: 20px;
}

.level-label { margin: 0 0 2px; color: var(--purple); font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.question-count { margin: 0 0 7px; font-weight: 900; }
.score-pill { padding: 11px 17px; background: white; border: 2px solid var(--line); border-radius: 17px; font-size: 20px; }

.question-card {
  padding: clamp(24px, 5vw, 46px);
  text-align: center;
  background: rgba(255, 255, 255, .96);
  border: 2px solid white;
  border-radius: 32px;
  box-shadow: 0 22px 50px rgba(46, 38, 99, .11);
}

.picture {
  width: 150px;
  height: 150px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  background: #f0eeff;
  border-radius: 44px;
  font-size: 70px;
}

.prompt-label {
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 900;
}

.english-prompt {
  width: 100%;
  padding: 18px 18px 16px;
  color: var(--ink);
  background: #fff8df;
  border: 3px solid #ffe08c;
  border-radius: 24px;
  cursor: pointer;
  font: 900 clamp(42px, 8vw, 70px) "Baloo 2", sans-serif;
  line-height: 1;
  box-shadow: 0 12px 24px rgba(216, 168, 77, .15);
}

.listen-icon {
  display: inline-block;
  margin-left: 10px;
  font-size: .38em;
  vertical-align: middle;
}

.answers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 24px 0 18px;
}

.answer-button {
  min-height: 66px;
  padding: 12px 16px;
  color: var(--ink);
  background: white;
  border: 3px solid var(--line);
  border-radius: 20px;
  cursor: pointer;
  font: 900 22px "Nunito", "Microsoft YaHei", "PingFang SC", sans-serif;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}

.answer-button:hover,
.answer-button:focus-visible,
.answer-button.selected {
  border-color: var(--purple);
  box-shadow: 0 10px 22px rgba(91, 80, 214, .12);
  transform: translateY(-2px);
  outline: none;
}

.answer-button.correct { border-color: var(--green); background: #edfff6; }
.answer-button.wrong { border-color: var(--red); background: #fff0f0; }

.feedback {
  min-height: 28px;
  margin: 0 0 12px;
  font-weight: 900;
}
.feedback.correct { color: #1f925d; }
.feedback.try { color: #b55619; }

.result-screen {
  max-width: 760px;
  margin: 28px auto 70px;
  padding: clamp(28px, 6vw, 50px);
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: white;
  border: 3px solid var(--line);
  border-radius: 34px;
  box-shadow: 0 22px 50px rgba(46, 38, 99, .11);
}

.result-mascot { width: 130px; margin-bottom: 10px; }
.eyebrow { margin: 0 0 10px; color: var(--purple); font-size: 13px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.result-screen h1 { font-size: clamp(42px, 6vw, 62px); }
.result-message { color: var(--muted); font-size: 18px; }
.final-score { display: grid; gap: 6px; margin: 18px 0 24px; }
.score-stars { color: #e7aa21; font-size: 28px; }
.final-score strong { font-size: 36px; }
.final-score small { color: var(--muted); font-weight: 900; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.secondary-button {
  min-height: 48px;
  padding: 0 20px;
  color: var(--purple);
  background: #f1efff;
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  font-weight: 900;
}

.standard-footer {
  text-align: center;
  padding: 30px 16px 36px;
}
.standard-footer .footer-tagline { color: #d8a84d; font-weight: 900; }
.standard-footer .footer-copyright { color: var(--muted); }

#fireworks {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.flagged-practice-button,
.flag-question-button {
  border: 0;
  cursor: pointer;
  font-weight: 900;
}
.flagged-practice-button {
  display: inline-grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-self: center;
  margin: 0 auto 20px;
  padding: 12px 18px;
  color: var(--purple);
  background: #f1efff;
  border-radius: 18px;
}
.flagged-practice-button span { grid-row: span 2; font-size: 24px; }
.flagged-practice-button small { color: var(--muted); }
.flag-question-button {
  margin-bottom: 12px;
  padding: 8px 12px;
  color: #8a6312;
  background: #fff4d4;
  border-radius: 999px;
}
.flag-question-button.flagged { color: #fff; background: #d8a84d; }
.star-glow { animation: star-glow .75s ease; }

@keyframes star-glow {
  50% { box-shadow: 0 0 0 8px rgba(255, 214, 70, .28), 0 22px 50px rgba(46, 38, 99, .11); }
}

@keyframes mascot-bob {
  50% { transform: translateY(-12px) rotate(2deg); }
}

@media (max-width: 850px) {
  .level-hero { grid-template-columns: 1fr; }
  .level-hero-copy {
    position: relative;
    inset: auto;
    background: #031735;
  }
  .level-grid { grid-template-columns: repeat(2, 1fr); }
  .progress-summary { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  main,
  .site-header { width: min(100% - 20px, 1120px); }
  .site-header { height: 76px; }
  .answers { grid-template-columns: 1fr; }
  .level-grid { grid-template-columns: 1fr; }
  .picture { width: 112px; height: 112px; font-size: 52px; border-radius: 32px; }
  .english-prompt { font-size: clamp(34px, 12vw, 48px); }
  .question-card { border-radius: 24px; }
}

/* Established StarPath module visual alignment layer */
:root {
  --starpath-navy: #031735;
  --starpath-navy-deep: #02122b;
  --starpath-navy-card: #07224b;
  --starpath-gold: #d8a84d;
  --starpath-gold-bright: #ffd071;
  --starpath-purple: #5b50d6;
  --starpath-purple-dark: #4339b7;
  --starpath-text: #ffffff;
  --starpath-muted: #c2cede;
}

html { background: var(--starpath-navy); }

body {
  position: relative;
  overflow-x: hidden;
  color: var(--starpath-text);
  background:
    radial-gradient(circle at 12% 10%, rgba(216, 168, 77, .1), transparent 24%),
    radial-gradient(circle at 86% 24%, rgba(91, 80, 214, .15), transparent 25%),
    linear-gradient(180deg, var(--starpath-navy-deep), var(--starpath-navy) 48%, #051632);
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: .48;
  background-image:
    radial-gradient(circle at 8% 14%, rgba(255, 208, 113, .8) 0 1px, transparent 1.6px),
    radial-gradient(circle at 18% 37%, rgba(255, 255, 255, .65) 0 1px, transparent 1.5px),
    radial-gradient(circle at 31% 9%, rgba(255, 208, 113, .65) 0 1px, transparent 1.7px),
    radial-gradient(circle at 47% 28%, rgba(255, 255, 255, .5) 0 1px, transparent 1.5px),
    radial-gradient(circle at 63% 12%, rgba(255, 208, 113, .72) 0 1px, transparent 1.7px),
    radial-gradient(circle at 78% 39%, rgba(255, 255, 255, .55) 0 1px, transparent 1.5px),
    radial-gradient(circle at 91% 17%, rgba(255, 208, 113, .7) 0 1px, transparent 1.7px);
  background-size: 310px 270px, 380px 330px, 430px 310px, 360px 390px, 410px 300px, 340px 370px, 390px 320px;
}

body::after {
  position: fixed;
  z-index: -1;
  right: 0;
  bottom: 0;
  left: 0;
  height: 24vh;
  content: "";
  pointer-events: none;
  background: linear-gradient(to top, rgba(31, 55, 84, .22), transparent);
}

body:not(.game-active) main { min-height: calc(100vh - 126px); }

.site-header {
  width: min(1280px, calc(100% - 40px));
  min-height: 82px;
  height: auto;
  padding-block: 10px;
  color: var(--starpath-text);
  background: transparent;
}

.site-header .module-home-button,
.site-header .back-zh-english-button,
.site-header .voice-gender-selector,
.site-header .sound-button {
  border: 1px solid rgba(216, 168, 77, .28);
  background: rgba(5, 22, 50, .78);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22), inset 0 1px rgba(255, 255, 255, .04);
  backdrop-filter: blur(12px);
}

.site-header .module-home-nav {
  width: 62px;
  flex-basis: 62px;
  margin-right: 28px;
}

.site-header .module-home-button {
  width: 62px;
  height: 62px;
  flex-basis: 62px;
  border-color: var(--starpath-gold);
}

.site-header .module-header-controls {
  gap: 22px;
  margin-left: auto;
}

.site-header .back-zh-english-button {
  color: #fff;
  background: linear-gradient(180deg, #685ee2, var(--starpath-purple));
  border-color: rgba(255, 255, 255, .12);
  box-shadow: 0 5px 0 var(--starpath-purple-dark), 0 9px 22px rgba(0, 0, 0, .22);
}

.site-header .sound-button { color: #fff; }
.site-header .voice-gender-selector { padding: 3px; }
.site-header .voice-gender-selector button { color: #f4d77e; }
.site-header .voice-gender-selector button.active { color: #17233d; background: #ffd646; }

.voice-status {
  color: var(--starpath-gold-bright);
  background: rgba(5, 22, 50, .94);
  border: 1px solid rgba(216, 168, 77, .28);
}

main { width: min(1280px, calc(100% - 40px)); }
.eyebrow { color: var(--starpath-gold-bright); }
h1, h2 { color: #fff; }

.level-screen { padding: 18px 0 64px; }

.level-hero {
  display: grid;
  grid-template-columns: minmax(250px, 1.15fr) minmax(370px, 1.85fr) minmax(220px, 1fr);
  align-items: center;
  gap: clamp(18px, 2.6vw, 38px);
  margin-bottom: 38px;
  min-height: 360px;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.level-hero-scene {
  position: relative;
  isolation: isolate;
  align-self: center;
  width: 100%;
  min-height: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0;
}

.level-hero-scene::before {
  position: absolute;
  z-index: 0;
  inset: 9% 4% 7%;
  content: "";
  background: rgba(31, 171, 196, .15);
  border-radius: 50%;
  filter: blur(34px);
}

.level-hero-scene::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(to right, var(--starpath-navy) 0%, transparent 18%, transparent 58%, var(--starpath-navy) 100%),
    linear-gradient(to bottom, transparent 58%, rgba(3, 23, 53, .48) 76%, var(--starpath-navy) 100%);
}

.level-hero-scene img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(.92) contrast(1.02);
}

.level-hero-copy {
  position: relative;
  inset: auto;
  z-index: 2;
  display: block;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: center;
}

.level-heading { max-width: none; margin-bottom: 24px; text-align: center; }
.module-identifier {
  margin: 0 0 18px;
  color: var(--starpath-gold-bright);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .15em;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
}
.module-identifier span {
  display: block;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.journey-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  margin: 0 auto 20px;
  color: var(--starpath-gold-bright);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.journey-kicker img {
  width: 30px;
  height: 20px;
  object-fit: cover;
  border-radius: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .25);
}

.level-heading h1 {
  color: #fff;
  font-size: clamp(58px, 6.4vw, 84px);
  line-height: .92;
  text-shadow: 0 5px 24px rgba(0, 0, 0, .35);
}

.level-heading .level-total {
  margin: 18px auto 0;
  color: var(--starpath-gold-bright);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .12em;
  line-height: 1;
  text-transform: uppercase;
}

.level-heading > p:last-child {
  max-width: 430px;
  margin: 10px auto 0;
  color: var(--starpath-muted);
  font-size: 17px;
  line-height: 1.55;
}

.level-hero-mascot {
  position: relative;
  width: min(100%, 300px);
  min-height: 300px;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 1px solid rgba(216, 168, 77, .2);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 80, 214, .25), rgba(5, 22, 50, .22) 58%, transparent 59%);
  box-shadow: inset 0 0 40px rgba(216, 168, 77, .04);
}

.level-hero-mascot > img {
  width: min(82%, 245px);
  filter: drop-shadow(0 18px 16px rgba(0, 0, 0, .3));
  animation: mascot-bob 3.2s ease-in-out infinite;
}

.level-speech-bubble {
  position: absolute;
  z-index: 3;
  top: -8%;
  right: -12%;
  width: clamp(130px, 14vw, 190px);
  min-width: 0;
  max-width: min(220px, 52vw);
  aspect-ratio: 520 / 190;
  padding: 0 18%;
  color: #0F2B5B;
  background: url("../../../../assets/Speech-bubble.svg") center / contain no-repeat;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font: 600 clamp(18px, 1.8vw, 24px)/1.05 "Baloo 2", sans-serif;
  letter-spacing: .01em;
  text-align: center;
  white-space: nowrap;
  transform: rotate(3deg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.mascot-star {
  position: absolute;
  color: var(--starpath-gold-bright);
  text-shadow: 0 0 12px rgba(255, 208, 113, .55);
}
.mascot-star-one { right: 3%; bottom: 18%; font-size: 22px; }
.mascot-star-two { top: 28%; left: 3%; font-size: 34px; }

.flagged-practice-button {
  width: min(100%, 430px);
  min-height: 54px;
  margin: 0 auto 24px;
  padding: 8px 14px;
  display: grid;
  grid-template-columns: auto auto auto;
  justify-content: center;
  color: #fff;
  background: linear-gradient(145deg, rgba(7, 34, 75, .92), rgba(4, 27, 63, .94));
  border: 1px solid rgba(216, 168, 77, .55);
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .22), inset 0 1px rgba(255, 255, 255, .04);
}

.flagged-practice-button > span {
  width: 21px;
  height: 24px;
  display: block;
  grid-row: span 2;
  font-size: 0;
  color: var(--starpath-gold-bright);
}

.flagged-practice-button > span::before {
  width: 18px;
  height: 22px;
  display: block;
  content: "";
  background: var(--starpath-gold-bright);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 28'%3E%3Cpath fill='black' d='M4 2h16a2 2 0 0 1 2 2v22l-10-6-10 6V4a2 2 0 0 1 2-2Zm2 4v13l6-3.6 6 3.6V6H6Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 28'%3E%3Cpath fill='black' d='M4 2h16a2 2 0 0 1 2 2v22l-10-6-10 6V4a2 2 0 0 1 2-2Zm2 4v13l6-3.6 6 3.6V6H6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.flagged-practice-button small {
  margin-left: 2px;
  color: var(--starpath-muted);
  white-space: nowrap;
}

.flag-question-button {
  border: 2px solid var(--line);
}

.flag-question-button.flagged {
  color: #8b6500;
  background: #fff1b8;
  border-color: #d8b54c;
}

.level-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

.level-card {
  position: relative;
  isolation: isolate;
  min-height: 156px;
  overflow: hidden;
  padding: 13px 14px 11px;
  color: #fff;
  background-color: var(--starpath-navy-card);
  background-image: linear-gradient(155deg, rgba(9, 43, 91, .98), rgba(4, 24, 56, .98)) !important;
  border: 1px solid rgba(216, 168, 77, .34);
  border-radius: 22px;
  box-shadow: 0 13px 30px rgba(0, 0, 0, .23), inset 0 1px rgba(255, 255, 255, .035);
}

.level-card::after {
  position: absolute;
  top: 13px;
  right: 14px;
  content: "☆";
  color: rgba(255, 208, 113, .75);
  font-size: 18px;
  line-height: 1;
}

.level-card .level-number,
.level-card strong,
.level-card small,
.level-card .level-best { text-shadow: none; }

.level-card:hover,
.level-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(255, 208, 113, .82);
  box-shadow: 0 19px 38px rgba(0, 0, 0, .3), 0 0 20px rgba(216, 168, 77, .07);
}

.level-number {
  width: 38px;
  height: 38px;
  color: var(--starpath-gold-bright);
  background: rgba(2, 18, 43, .72);
  border: 1px solid rgba(216, 168, 77, .58);
  border-radius: 50%;
}

.level-icon {
  margin: 7px 0 2px;
  font-size: 33px;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, .18));
}
.level-card strong { color: #fff; line-height: 1.08; }
.level-card small { margin-top: 2px; color: var(--starpath-muted); line-height: 1.2; }
.level-best { min-height: 17px; margin-top: 4px; color: var(--starpath-gold-bright); line-height: 1.2; }
.level-best::after { content: " →"; }

.learning-progress-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  margin-top: 42px;
  padding: 24px 28px;
  background: linear-gradient(145deg, rgba(7, 34, 75, .9), rgba(4, 27, 63, .94));
  border: 1px solid rgba(216, 168, 77, .46);
  border-radius: 24px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .24);
}

.progress-card-icon {
  width: 48px;
  height: 48px;
  color: var(--starpath-gold-bright);
  background: rgba(2, 18, 43, .65);
  border: 1px solid rgba(255, 208, 113, .72);
  border-radius: 50%;
  font-size: 22px;
}
.learning-progress-card h2 { margin: 0 0 6px; color: var(--starpath-gold-bright); font-size: 28px; }
.learning-progress-card p { margin: 0; color: var(--starpath-muted); font-size: 16px; line-height: 1.55; }
.progress-summary { margin-top: 16px; }
.progress-stat-heading { color: #fff; font-size: 12px; }
.progress-stat-heading span { color: var(--starpath-gold-bright); }
.dashboard-progress-track { background: rgba(255, 255, 255, .12); border: 1px solid rgba(216, 168, 77, .34); }
.dashboard-progress-track > span { background: linear-gradient(90deg, #d8a84d, #ffd071); }

.game-screen { max-width: 780px; }
.question-card {
  background: rgba(255, 255, 255, .96);
  border: 2px solid white;
  border-radius: 32px;
  box-shadow: 0 22px 50px rgba(46, 38, 99, .11);
}

.picture {
  width: 150px;
  height: 150px;
  margin: 0 auto 16px;
  background: #f0eeff;
  border-radius: 44px;
  font-size: 86px;
  animation: pop .35s both;
}

.prompt-label { margin: 0 0 4px; color: var(--muted); font-weight: 800; }
.english-prompt {
  margin: 2px auto 0;
  padding: 4px 14px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: auto;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 15px;
  box-shadow: none;
  cursor: pointer;
  font: 800 38px/1.15 "Baloo 2", sans-serif;
}

.english-prompt:hover,
.english-prompt:focus-visible { background: #f0eeff; outline: none; }
.listen-icon { font-size: 22px; }
.answers { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 26px 0 19px; }

.answer-button {
  min-height: 61px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  background: white;
  border: 3px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  font-size: 19px;
  font-weight: 900;
  text-align: left;
  transition: transform .12s, border-color .12s, background .12s;
}
.answer-button:hover { transform: translateX(3px); border-color: #bbb3ef; }
.answer-button.selected { border-color: var(--purple); background: #f0eeff; }
.answer-button.correct { color: #16774a; border-color: var(--green); background: #e5f8ee; }
.answer-button.wrong { color: #a84440; border-color: var(--red); background: #fff0ef; }

.feedback { min-height: 35px; font-size: 18px; font-weight: 900; }
.feedback.correct { color: #168354; }
.feedback.try { color: #b44c47; }
.submit-button { width: 100%; }

.result-screen {
  position: relative;
  min-height: 670px;
  padding: 35px 20px 70px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.result-screen h1 { font-size: clamp(48px, 7vw, 76px); color: var(--starpath-purple); }
.result-mascot { width: 190px; margin-bottom: -10px; filter: drop-shadow(0 15px 12px rgba(62, 46, 127, .16)); }
.result-message { margin: 14px 0 20px; color: var(--starpath-muted); font-size: 19px; }
.final-score { min-width: 260px; margin-bottom: 27px; padding: 20px 40px; background: white; border-radius: 27px; box-shadow: 0 16px 35px rgba(47, 40, 95, .12); }
.secondary-button { color: var(--purple); background: white; border: 2px solid #cfc9ef; border-radius: 17px; }

.standard-footer .footer-tagline,
footer { color: var(--starpath-gold-bright); }

.site-header .sound-button {
  position: relative;
  isolation: isolate;
  width: 76px;
  min-width: 76px;
  height: 38px;
  padding: 3px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  overflow: hidden;
  border-radius: 999px;
}
.site-header .sound-button::before {
  position: absolute;
  z-index: -1;
  top: 3px;
  left: 3px;
  width: 34px;
  height: 30px;
  content: "";
  background: var(--starpath-purple);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
  transform: translateX(34px);
  transition: transform 180ms ease;
}
.site-header .sound-button.sound-on::before { transform: translateX(0); }
.sound-option {
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  opacity: .52;
  filter: grayscale(.55);
  font-size: 15px;
  line-height: 1;
  transition: opacity 180ms ease, filter 180ms ease;
}
.sound-button.sound-on .sound-on-icon,
.sound-button:not(.sound-on) .sound-off-icon { opacity: 1; filter: none; }

@media (max-width: 1080px) {
  .level-hero { grid-template-columns: minmax(220px, 1.1fr) minmax(320px, 1.8fr) minmax(200px, 1fr); gap: 22px; }
  .level-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .level-speech-bubble { right: -2%; width: clamp(112px, 22vw, 170px); }
}

@media (max-width: 840px) {
  .site-header { width: calc(100% - 24px); }
  .level-hero { grid-template-columns: minmax(180px, .8fr) minmax(300px, 1.2fr); }
  .level-hero-copy { grid-column: 1 / -1; grid-row: 1; }
  .level-hero-scene { grid-column: 1; grid-row: 2; min-height: 240px; }
  .level-hero-mascot { grid-column: 2; grid-row: 2; width: min(100%, 270px); min-height: 270px; }
  .level-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .site-header { flex-wrap: nowrap; }
  .site-header .module-header-controls { gap: 8px; margin-left: auto; }
  .site-header .module-home-nav { width: 48px; flex-basis: 48px; margin-right: 12px; }
  .site-header .module-home-button { width: 48px; height: 48px; flex-basis: 48px; }
  main { width: calc(100% - 24px); }
  .level-screen { padding-top: 8px; }
  .level-hero { grid-template-columns: 1fr; gap: 18px; min-height: 0; margin-bottom: 28px; }
  .level-hero-scene,
  .level-hero-copy,
  .level-hero-mascot { grid-column: 1; grid-row: auto; }
  .level-hero-scene { min-height: 205px; }
  .level-heading h1 { font-size: clamp(42px, 13vw, 56px); }
  .level-heading > p:last-child { font-size: 16px; }
  .level-hero-mascot { width: min(78vw, 270px); min-height: 250px; }
  .level-hero-mascot > img { width: min(78%, 215px); }
  .level-speech-bubble { top: -2%; right: -3%; width: clamp(106px, 34vw, 160px); max-width: min(160px, 48vw); font-size: 16px; }
  .level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .level-card { min-height: 151px; padding: 12px 10px 10px; }
  .learning-progress-card { grid-template-columns: auto 1fr; gap: 14px; padding: 20px; }
  .learning-progress-card h2 { font-size: 24px; }
  .progress-summary { grid-column: 1 / -1; grid-template-columns: 1fr; gap: 13px; }
  .site-header .sound-button { width: 68px; min-width: 68px; height: 36px; padding: 3px; }
  .site-header .sound-button::before { width: 30px; height: 28px; transform: translateX(30px); }
  .site-header .sound-button.sound-on::before { transform: translateX(0); }
  .sound-option { width: 30px; height: 28px; font-size: 14px; }
}

@media (max-width: 390px) {
  .level-grid { grid-template-columns: 1fr; }
  .level-card { min-height: 145px; }
  .level-hero-scene { min-height: 185px; }
  .level-hero-mascot { width: min(76vw, 250px); min-height: 230px; }
}

/*
 * Chinese-speaker module header alignment.
 * This final override sits after the premium module restyle so the
 * StarPath home logo stays in the normal left-side flow on desktop and
 * mobile, matching the English-speaker module header behaviour.
 */
.site-header {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.site-header .module-home-nav {
  position: relative;
  inset: auto;
  order: 0;
  margin: 0 20px 0 0;
  padding: 0;
  flex: 0 0 58px;
  width: 58px;
  justify-content: flex-start;
}

.site-header .module-home-button {
  flex: 0 0 58px;
}

.site-header .module-header-controls {
  order: 1;
  margin-left: auto;
}

@media (max-width: 640px) {
  .site-header {
    justify-content: flex-start;
  }

  .site-header .module-home-nav {
    position: relative !important;
    inset: auto !important;
    margin: 0 12px 0 0;
    flex-basis: 48px;
    width: 48px;
  }

  .site-header .module-home-button {
    flex-basis: 48px;
  }

  .site-header .module-header-controls {
    margin-left: auto;
  }
}

@media (max-width: 620px) {
  .site-header .module-home-nav {
    margin-right: 6px;
    flex-basis: 40px;
    width: 40px;
  }

  .site-header .module-home-button {
    flex-basis: 40px;
  }

  .site-header .module-header-controls {
    margin-left: auto;
  }
}
