:root{
  --math-tutor-zone-width:clamp(280px,30vw,460px);
  --math-tutor-zone-width-short:clamp(240px,29vw,360px);
  --math-tutor-zone-width-tablet:clamp(220px,31vw,320px);
  --math-tutor-zone-width-phone:clamp(200px,33vw,280px);
  --math-tutor-zone-width-phone-short:clamp(190px,32vw,260px);
  --math-tutor-copy-width:320px;
  --math-tutor-font-family:system-ui,sans-serif;
  --math-tutor-question-size:clamp(1.75rem,1.62rem + .58vw,2rem);
  --math-tutor-question-size-short:clamp(1.5rem,2.55vw,1.75rem);
  --math-tutor-question-size-phone:clamp(1.25rem,3.6vw,1.5rem);
  --math-tutor-copy-weight:600;
  --math-tutor-copy-line-height:1.28;
  --math-tutor-copy-letter-spacing:-.025em;
  --math-tutor-reveal-duration:.42s;
  --math-tutor-reveal-stagger:46ms;
  --math-tutor-zone-background:var(--math-app-background,radial-gradient(110% 135% at 10% 8%,#0f1452 0%,#040638 45.0975%,#101d3b 95.407%))
}

/* Shared structural contract for Topic and Lesson in later steps. Gameplay
   retains its existing rules and only consumes these exact source values. */
[data-shared-tutor-zone]{
  min-width:0;
  color:#fff;
  background:var(--math-tutor-zone-background)
}

/* Topic and Lesson paint the shared background once on their full-screen shell,
   so the radial gradient stays continuous across both zones. */
.math-topic-screen>[data-shared-tutor-zone],
.math-lessons-screen>[data-shared-tutor-zone]{background:transparent}
[data-shared-tutor-zone] [data-role="instruction"]{
  width:min(100%,var(--math-tutor-copy-width));
  max-width:var(--math-tutor-copy-width);
  margin:0;
  color:#fff;
  font-family:var(--math-tutor-font-family);
  font-size:var(--math-tutor-question-size);
  font-weight:var(--math-tutor-copy-weight);
  line-height:var(--math-tutor-copy-line-height);
  letter-spacing:var(--math-tutor-copy-letter-spacing);
  overflow-wrap:break-word;
  hyphens:auto
}
[data-shared-tutor-zone]:dir(rtl) [data-role="instruction"]{text-align:right}
[data-shared-tutor-zone] .math-tutor-copy{display:block;white-space:pre-line}
[data-shared-tutor-zone] .math-tutor-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
[data-shared-tutor-zone] .math-tutor-word{display:inline-block}
[data-shared-tutor-zone] .math-tutor-copy.is-word-reveal .math-tutor-word{opacity:0;transform:translate3d(0,.32em,0);animation:math-shared-tutor-word-in var(--math-tutor-reveal-duration) cubic-bezier(.22,1,.36,1) forwards;animation-delay:calc(var(--math-tutor-word-index) * var(--math-tutor-reveal-stagger))}
[data-shared-tutor-zone][data-tutor-audio-state="loading"] .math-tutor-copy.is-word-reveal .math-tutor-word,[data-shared-tutor-zone][data-tutor-audio-state="paused"] .math-tutor-copy.is-word-reveal .math-tutor-word{animation-play-state:paused}
@keyframes math-shared-tutor-word-in{to{opacity:1;transform:translate3d(0,0,0)}}
@media(prefers-reduced-motion:reduce){[data-shared-tutor-zone] .math-tutor-copy.is-word-reveal .math-tutor-word{opacity:1;filter:none;transform:none;animation:none}}
