/* Learning Gem - landing page v2 (simple, kid-first). Original palette: purple bar, lavender, indigo cave, yellow buttons. */
html.lg-landing #root > .min-h-screen, html.lg-landing #root > div > .min-h-screen { display: none !important; }
html.lg-landing body { background: #ede4fe; }
#lg-land[hidden] { display: none !important; }

#lg-land.lg2 {
  --display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ink: #2e1065;
  --ink-2: #5b3f99;
  font-family: var(--body);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background-color: #ede4fe;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23c4b5fd' stroke-opacity='.35' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M22 18h16l7 8-15 19-15-19z'/%3E%3Cpath d='M82 78h12l5 6-11 14-11-14z'/%3E%3C/g%3E%3C/svg%3E");
}
#lg-land.lg2 *, #lg-land.lg2 *::before, #lg-land.lg2 *::after { box-sizing: border-box; }
#lg-land.lg2 img, #lg-land.lg2 video { display: block; max-width: 100%; }
#lg-land.lg2 button { font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#lg-land.lg2 a { -webkit-tap-highlight-color: transparent; }
#lg-land.lg2 :focus-visible { outline: 4px solid #facc15; outline-offset: 3px; }
.lg2-wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

/* top bar (original purple gradient) */
.lg2-top { position: sticky; top: 0; z-index: 30; background: linear-gradient(90deg, #7c3aed, #9333ea 50%, #4f46e5); box-shadow: 0 4px 0 rgba(76, 29, 149, .25); }
.lg2-top .lg2-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding-top: env(safe-area-inset-top); }
#lg-land .lg2-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: #fff; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 22px; white-space: nowrap; }
.lg2-brand svg { width: 38px; height: 38px; flex: 0 0 auto; }
.lg2-grown { display: flex; gap: 6px; }
#lg-land .lg2-grown a { color: #fff; text-decoration: none; font-weight: 800; font-size: 15px; min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 999px; background: rgba(255, 255, 255, .14); }
#lg-land .lg2-grown a:hover { background: rgba(255, 255, 255, .26); }
#lg-land .lg2-grown a.narrow { display: none; }
@media (max-width: 420px) { #lg-land .lg2-grown a.wide { display: none; } #lg-land .lg2-grown a.narrow { display: inline-flex; } }
#lg-land .lg2-grown a { white-space: nowrap; }
@media (max-width: 360px) { #lg-land .lg2-brand { font-size: 19px; gap: 8px; } .lg2-brand svg { width: 32px; height: 32px; } #lg-land .lg2-grown a { padding: 0 12px; font-size: 14px; } }
.lg2-adults { scroll-margin-top: 64px; }

/* hero */
.lg2-hero { position: relative; overflow: hidden; text-align: center; padding: clamp(22px, 4vw, 44px) 0 clamp(40px, 6vw, 64px); }
.lg2-hero .lg2-wrap { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.lg2-deco { position: absolute; inset: 0; pointer-events: none; }
.lg2-deco span { position: absolute; opacity: .8; filter: drop-shadow(0 8px 10px rgba(76, 29, 149, .25)); }
.lg2-deco svg { width: 100%; height: 100%; }
@media (max-width: 760px) { .lg2-deco span:nth-child(5) { display: none; } .lg2-deco span { opacity: .55; transform: scale(.75); } .lg2-deco span:nth-child(1) { top: 2% !important; } .lg2-deco span:nth-child(2) { top: 1% !important; } }
.lg2-stage { position: relative; width: min(720px, 100%); }
.lg2-frame { border-radius: 36px; overflow: hidden; aspect-ratio: 1280 / 732; background: #ddd0fb; border: 6px solid #fff; box-shadow: 0 10px 0 #c4b5fd, 0 30px 50px -20px rgba(76, 29, 149, .5); }
.lg2-frame video { width: 100%; height: 100%; object-fit: cover; }
.lg2-bubble { position: absolute; right: -6px; top: -14px; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 16px 8px 10px; border: 0; border-radius: 22px 22px 22px 6px; background: #fff; color: #5b21b6; font-weight: 900; font-size: 15px; box-shadow: 0 5px 0 #c4b5fd, 0 12px 24px -10px rgba(76, 29, 149, .5); }
.lg2-bubble svg { width: 30px; height: 30px; padding: 5px; border-radius: 999px; background: #7c3aed; color: #fff; flex: 0 0 auto; }
.lg2-bubble.talking svg { animation: lg2Pulse .6s ease-in-out infinite alternate; }
@media (max-width: 520px) { .lg2-bubble { right: 4px; top: -18px; font-size: 13.5px; min-height: 44px; } }
.lg2-h1 { font-family: var(--display); font-weight: 600; font-size: clamp(42px, 8vw, 80px); line-height: 1.02; letter-spacing: -.01em; margin: 28px 0 10px; color: #4c1d95; }
.lg2-h1 span { display: inline-block; }
.lg2-h1 .shine { color: #4c1d95; background: linear-gradient(90deg, #7c3aed, #db2777, #ea8a00); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; padding: 0 .04em; }
.lg2-sub { font-size: clamp(18px, 2.2vw, 22px); font-weight: 700; color: var(--ink-2); max-width: 30em; margin: 0 auto 24px; }
.lg2-go { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 76px; padding: 0 44px 0 34px; border: 0; border-radius: 999px; background: linear-gradient(90deg, #facc15, #fbbf24); color: #3b0764; font-family: var(--display); font-weight: 600; font-size: clamp(26px, 4vw, 32px); box-shadow: 0 8px 0 #d9a406, 0 18px 30px -12px rgba(217, 164, 6, .8); transition: transform .12s ease, box-shadow .12s ease; }
.lg2-go svg { width: 34px; height: 34px; }
.lg2-go:active { transform: translateY(6px); box-shadow: 0 2px 0 #d9a406; }
.lg2-note { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 26px 0 0; padding: 0; }
.lg2-note span { background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 14px; color: #5b21b6; box-shadow: 0 3px 0 #ddd6fe; }

/* sections */
.lg2-sec { padding: clamp(40px, 6vw, 72px) 0; }
.lg2-h2 { font-family: var(--display); font-weight: 600; text-align: center; font-size: clamp(32px, 5vw, 48px); line-height: 1.1; margin: 0 0 clamp(20px, 3vw, 32px); color: #2e1065; }
.lg2-h2.sm { font-size: clamp(26px, 4vw, 36px); }

/* worlds: big chunky tiles */
.lg2-worlds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 24px); }
@media (min-width: 900px) { .lg2-worlds { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lg2-world { display: flex; flex-direction: column; padding: 8px; border: 0; border-radius: 30px; background: var(--c); color: #fff; text-align: left; box-shadow: 0 8px 0 var(--d), 0 20px 30px -16px rgba(46, 16, 101, .5); transition: transform .12s ease, box-shadow .12s ease; }
.lg2-world:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--d); }
.lg2-world .pic { display: block; border-radius: 22px; overflow: hidden; aspect-ratio: 4 / 3; background: rgba(255, 255, 255, .25); }
.lg2-world .pic img { width: 100%; height: 100%; object-fit: cover; }
.lg2-world .lbl { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 8px 6px 10px; }
.lg2-world b { font-family: var(--display); font-weight: 600; font-size: clamp(20px, 2.6vw, 26px); line-height: 1.1; }
.lg2-world i { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 999px; background: #fff; color: var(--d); display: grid; place-items: center; }
.lg2-world i svg { width: 22px; height: 22px; margin-left: 3px; }
@media (max-width: 400px) { .lg2-world b { font-size: 18px; } .lg2-world i { width: 36px; height: 36px; } }

/* cave: gems + grades (original dark indigo) */
.lg2-cave { background: radial-gradient(900px 500px at 50% 0, #34217a 0, #1d0c44 72%); color: #fff; border-radius: 48px 48px 0 0; }
.lg2-cave .lg2-h2 { color: #fff; }
.lg2-gems { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(8px, 1.6vw, 16px); max-width: 860px; margin: 0 auto clamp(40px, 6vw, 60px); }
@media (max-width: 560px) { .lg2-gems { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lg2-gem { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 4px 14px; min-height: 140px; border-radius: 26px; border: 3px solid color-mix(in srgb, var(--gc) 60%, transparent); background: color-mix(in srgb, var(--gc) 22%, #1d0c44); color: #fff; box-shadow: 0 6px 0 color-mix(in srgb, var(--gc) 45%, #0b0420); transition: transform .12s ease, box-shadow .12s ease; }
.lg2-gem:active { transform: translateY(5px); box-shadow: 0 1px 0 color-mix(in srgb, var(--gc) 45%, #0b0420); }
.lg2-gem svg { width: clamp(52px, 8vw, 68px); height: clamp(52px, 8vw, 68px); filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .3)); }
.lg2-gem b { font-family: var(--display); font-weight: 600; font-size: clamp(16px, 2vw, 19px); color: var(--gl); margin-top: 4px; }
.lg2-gem small { font-weight: 800; font-size: 13px; color: #ddd6fe; }
.lg2-grades { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(10px, 2vw, 18px); }
.lg2-grade { width: clamp(84px, 13vw, 104px); height: clamp(84px, 13vw, 104px); border-radius: 999px; border: 0; background: #fff; color: #4c1d95; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 6px 0 #a78bfa; transition: transform .12s ease, box-shadow .12s ease; }
.lg2-grade:nth-child(1) { background: #fecdd3; box-shadow: 0 6px 0 #e11d48; color: #881337; }
.lg2-grade:nth-child(2) { background: #fde68a; box-shadow: 0 6px 0 #d97706; color: #78350f; }
.lg2-grade:nth-child(3) { background: #bbf7d0; box-shadow: 0 6px 0 #16a34a; color: #14532d; }
.lg2-grade:nth-child(4) { background: #bfdbfe; box-shadow: 0 6px 0 #2563eb; color: #1e3a8a; }
.lg2-grade:nth-child(5) { background: #e9d5ff; box-shadow: 0 6px 0 #9333ea; color: #581c87; }
.lg2-grade:nth-child(6) { background: #a5f3fc; box-shadow: 0 6px 0 #0891b2; color: #164e63; }
.lg2-grade:active { transform: translateY(5px); box-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.lg2-grade b { font-family: var(--display); font-weight: 600; font-size: clamp(34px, 5vw, 44px); }
.lg2-grade small { font-weight: 900; font-size: 12.5px; margin-top: 2px; }
@media (max-width: 400px) { .lg2-grades { gap: 10px; } .lg2-grade { width: 82px; height: 82px; } }

/* grown-ups */
.lg2-adults { background: #f2f0fa; }
.lg2-cards { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .lg2-cards { grid-template-columns: repeat(3, 1fr); } }
#lg-land .lg2-card { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 24px; background: #fff; border: 2px solid #ddd6fe; color: #2e1065; text-decoration: none; min-height: 96px; box-shadow: 0 4px 0 #ddd6fe; transition: transform .12s ease; }
#lg-land .lg2-card:hover { transform: translateY(-3px); }
.lg2-card img { width: 108px; height: 76px; object-fit: cover; border-radius: 16px; flex: 0 0 auto; }
.lg2-card span { font-size: 14.5px; font-weight: 700; color: #5b3f99; }
.lg2-card b { display: block; font-family: var(--display); font-weight: 600; font-size: 21px; color: #2e1065; }

/* footer */
.lg2-foot { background: #020617; color: #cbd5e1; padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); }
.lg2-foot .lg2-wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between; }
.lg2-foot nav { display: flex; flex-wrap: wrap; gap: 2px; }
#lg-land .lg2-foot nav a { color: #e2e8f0; text-decoration: none; font-weight: 800; min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 12px; }
#lg-land .lg2-foot nav a:hover { background: rgba(255, 255, 255, .08); }
.lg2-foot p { margin: 0; font-weight: 700; font-size: 14px; }

/* motion */
@media (prefers-reduced-motion: no-preference) {
  .lg2-deco span { animation: lg2Bob 6s ease-in-out infinite; }
  .lg2-h1 span:not(.shine) { animation: lg2Hop 3.2s ease-in-out infinite; }
  .lg2-h1 span:nth-child(2) { animation-delay: .1s; } .lg2-h1 span:nth-child(3) { animation-delay: .2s; } .lg2-h1 span:nth-child(4) { animation-delay: .3s; } .lg2-h1 span:nth-child(5) { animation-delay: .4s; }
  .lg2-h1 span:nth-child(6) { animation-delay: .6s; } .lg2-h1 span:nth-child(7) { animation-delay: .7s; } .lg2-h1 span:nth-child(8) { animation-delay: .8s; } .lg2-h1 span:nth-child(9) { animation-delay: .9s; }
  .lg2-go { animation: lg2Breathe 2.4s ease-in-out infinite; }
  .lg2-go:active { animation: none; }
  .lg2-world:hover { transform: translateY(-4px) rotate(-1deg); }
  .lg2-gem:hover svg { animation: lg2Wiggle .5s ease; }
  .lg2-grade:hover { transform: translateY(-3px) scale(1.04); }
}
@keyframes lg2Bob { 0%, 100% { translate: 0 0; rotate: -6deg; } 50% { translate: 0 -12px; rotate: 6deg; } }
@keyframes lg2Hop { 0%, 80%, 100% { transform: translateY(0); } 88% { transform: translateY(-8px); } }
@keyframes lg2Breathe { 0%, 100% { scale: 1; } 50% { scale: 1.04; } }
@keyframes lg2Wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes lg2Pulse { from { transform: scale(1); } to { transform: scale(1.15); } }

/* Dark blue replaced with a bright Learning Gem purple */
.lg2-cave { background: radial-gradient(900px 520px at 50% 0, #a855f7 0, #7c3aed 45%, #6d28d9 100%); }
.lg2-gem { background: color-mix(in srgb, var(--gc) 30%, #5b21b6); border-color: rgba(255, 255, 255, .55); box-shadow: 0 6px 0 #4c1d95; }
.lg2-gem:active { box-shadow: 0 1px 0 #4c1d95; }
.lg2-gem b { color: #fff; }
.lg2-gem small { color: #f3e8ff; }
.lg2-foot { background: #4c1d95; color: #ede9fe; }

/* Gems stand out: bright pastel cards, bigger glowing gems, sparkle */
.lg2-gem { position: relative; overflow: hidden; background: linear-gradient(180deg, #fff 0, var(--gl) 100%); border: 4px solid var(--gc); box-shadow: 0 7px 0 color-mix(in srgb, var(--gc) 70%, #000), 0 16px 26px -10px rgba(30, 0, 60, .55); padding-top: 18px; min-height: 156px; }
.lg2-gem:active { box-shadow: 0 1px 0 color-mix(in srgb, var(--gc) 70%, #000); }
.lg2-gem::before { content: ''; position: absolute; left: 50%; top: 44px; width: 96px; height: 96px; transform: translate(-50%, -50%); border-radius: 999px; background: radial-gradient(circle, #fff 0, color-mix(in srgb, var(--gc) 35%, #fff) 40%, transparent 70%); z-index: 0; }
.lg2-gem > * { position: relative; z-index: 1; }
.lg2-gem svg { width: clamp(62px, 9vw, 80px); height: clamp(62px, 9vw, 80px); filter: drop-shadow(0 6px 6px color-mix(in srgb, var(--gc) 55%, transparent)); }
.lg2-gem b { color: color-mix(in srgb, var(--gc) 80%, #000); font-size: clamp(17px, 2.1vw, 20px); }
.lg2-gem small { color: color-mix(in srgb, var(--gc) 60%, #333); }
.lg2-gem::after { content: ''; position: absolute; top: 14px; right: 16px; width: 14px; height: 14px; z-index: 2; background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); filter: drop-shadow(0 0 3px var(--gc)); }
@media (prefers-reduced-motion: no-preference) {
  .lg2-gem svg { animation: lg2Float 3s ease-in-out infinite; }
  .lg2-gem:nth-child(2) svg { animation-delay: -.6s; } .lg2-gem:nth-child(3) svg { animation-delay: -1.2s; } .lg2-gem:nth-child(4) svg { animation-delay: -1.8s; } .lg2-gem:nth-child(5) svg { animation-delay: -2.4s; }
  .lg2-gem::after { animation: lg2Twinkle 2.2s ease-in-out infinite; }
  .lg2-gem:nth-child(2)::after { animation-delay: -.5s; } .lg2-gem:nth-child(3)::after { animation-delay: -1s; } .lg2-gem:nth-child(4)::after { animation-delay: -1.5s; } .lg2-gem:nth-child(5)::after { animation-delay: -2s; }
  .lg2-gem:hover svg { animation: lg2Wiggle .5s ease; }
}
@keyframes lg2Float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes lg2Twinkle { 0%, 100% { opacity: .2; transform: scale(.6) rotate(0); } 50% { opacity: 1; transform: scale(1.1) rotate(45deg); } }
@media (max-width: 560px) { .lg2-gems { display: flex; flex-wrap: wrap; justify-content: center; } .lg2-gem { flex: 0 0 calc((100% - 16px) / 3); } }

/* Read-aloud buttons next to section titles */
.lg2-title { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 clamp(20px, 3vw, 32px); }
.lg2-title .lg2-h2 { margin: 0; }
.lg2-say { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 999px; border: 0; display: grid; place-items: center; background: #facc15; color: #3b0764; box-shadow: 0 4px 0 #d9a406; transition: transform .12s ease, box-shadow .12s ease; }
.lg2-say svg { width: 26px; height: 26px; }
.lg2-say:active { transform: translateY(3px); box-shadow: 0 1px 0 #d9a406; }
.lg2-say.talking svg { animation: lg2Pulse .6s ease-in-out infinite alternate; }
.lg2-cave .lg2-title { margin-top: 0; }
.lg2-cave .lg2-title + .lg2-grades, .lg2-gems + .lg2-title { margin-top: 0; }
.lg2-fine { text-align: center; max-width: 720px; margin: 22px auto 0; font-size: 14px; font-weight: 700; color: #5b3f99; }
#lg-land .lg2-fine a { color: #6d28d9; font-weight: 900; }

/* The gem or grade a child tapped on the landing page, highlighted in the sign-up */
[role="dialog"] .lg-picked { outline: 4px solid #facc15 !important; outline-offset: 2px; box-shadow: 0 0 0 8px rgba(250, 204, 21, .35) !important; }

/* Parent Dashboard note */
.lg-parent-note { margin: 16px 0; padding: 18px 20px; border-radius: 20px; background: #f5f3ff; border: 2px solid #ddd6fe; color: #2e1065; font-family: 'Nunito', system-ui, sans-serif; }
.lg-parent-note h3 { margin: 0 0 8px; font-size: 18px; font-weight: 900; }
.lg-parent-note p { margin: 0 0 10px; font-size: 15px; line-height: 1.5; color: #4b3f72; }
.lg-parent-note p:last-child { margin-bottom: 0; }
.lg-parent-note a { color: #6d28d9; font-weight: 800; }
#lg-land .lg2-fine a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; }

/* ===== Sign-up steps, restyled to match the landing page ===== */
html.lg-ob-open body > div.fixed.inset-0[data-state="open"]:not([role="dialog"]) {
  background: rgba(46, 16, 101, .72) !important; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
[role="dialog"].lg-ob {
  width: calc(100% - 24px) !important; max-width: 480px !important; max-height: 92dvh !important;
  padding: 18px 20px 22px !important; gap: 14px !important;
  border-radius: 32px !important; border: 4px solid #fff !important;
  background: linear-gradient(180deg, #f5f0ff 0%, #ede4fe 100%) !important;
  box-shadow: 0 10px 0 #c4b5fd, 0 24px 60px rgba(46, 16, 101, .45) !important;
  font-family: 'Nunito', system-ui, sans-serif; color: #2e1065;
}
[role="dialog"].lg-ob h2 {
  font-family: 'Fredoka', 'Nunito', sans-serif !important; font-weight: 600 !important;
  font-size: clamp(26px, 7vw, 32px) !important; line-height: 1.1 !important; color: #4c1d95 !important;
  text-align: center !important; margin: 0 !important;
}
[role="dialog"].lg-ob p.text-xs { font-size: 15px !important; font-weight: 700; color: #5b3f99 !important; }

/* Step tracker + speaker */
.lg-ob-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-right: 50px; min-height: 48px; }
.lg-ob-steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.lg-ob-steps li { display: flex; align-items: center; gap: 5px; padding: 5px 10px 5px 6px; border-radius: 999px; background: #fff; color: #a99bd0; font-weight: 900; font-size: 13px; box-shadow: 0 2px 0 #ddd6fe; }
.lg-ob-steps .g { width: 22px; height: 22px; display: grid; place-items: center; color: #d8ccf5; }
.lg-ob-steps .g svg { width: 20px; height: 20px; }
.lg-ob-steps li.done .g { color: #a855f7; }
.lg-ob-steps li.done { color: #6d28d9; }
.lg-ob-steps li.now { background: #7c3aed; color: #fff; box-shadow: 0 3px 0 #5b21b6; }
.lg-ob-steps li.now .g { color: #facc15; }
.lg-ob-say { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 999px; border: 0; display: grid; place-items: center; background: #facc15; color: #3b0764; box-shadow: 0 4px 0 #d9a406; cursor: pointer; }
.lg-ob-say svg { width: 26px; height: 26px; }
.lg-ob-say:active { transform: translateY(3px); box-shadow: 0 1px 0 #d9a406; }
.lg-ob-say.talking svg { animation: lg2Pulse .6s ease-in-out infinite alternate; }
@media (max-width: 380px) { .lg-ob-steps li .t { display: none; } .lg-ob-steps li { padding: 5px 8px; } }

/* Close button */
[role="dialog"].lg-ob > button.absolute {
  top: 14px !important; right: 14px !important; width: 44px; height: 44px; border-radius: 999px !important;
  display: grid; place-items: center; background: #fff !important; color: #6d28d9 !important; opacity: 1 !important;
  box-shadow: 0 3px 0 #ddd6fe; border: 2px solid #ddd6fe;
}
[role="dialog"].lg-ob > button.absolute svg { width: 20px; height: 20px; }

/* Name input */
[role="dialog"].lg-ob input[data-testid="input-name"] {
  height: 62px !important; border-radius: 22px !important; border: 3px solid #c4b5fd !important; background: #fff !important;
  font-family: 'Fredoka', 'Nunito', sans-serif; font-size: 24px !important; font-weight: 500; color: #2e1065 !important;
  box-shadow: inset 0 3px 0 rgba(124, 58, 237, .06);
}
[role="dialog"].lg-ob input[data-testid="input-name"]::placeholder { color: #9a89c9; }
[role="dialog"].lg-ob input[data-testid="input-name"]:focus { border-color: #7c3aed !important; box-shadow: 0 0 0 5px rgba(124, 58, 237, .18) !important; outline: none; }

/* Big yellow buttons (Next) */
[role="dialog"].lg-ob [data-testid="button-next-name"] {
  height: 62px !important; border-radius: 999px !important; border: 0 !important;
  background: #facc15 !important; color: #3b0764 !important; box-shadow: 0 6px 0 #d9a406 !important;
  font-family: 'Fredoka', 'Nunito', sans-serif; font-size: 24px !important; font-weight: 600 !important;
  transition: transform .12s ease, box-shadow .12s ease;
}
[role="dialog"].lg-ob [data-testid="button-next-name"]:active { transform: translateY(4px); box-shadow: 0 2px 0 #d9a406 !important; }
[role="dialog"].lg-ob [data-testid="button-next-name"]:disabled { opacity: .55 !important; filter: saturate(.6); }

/* Grade cards */
[role="dialog"].lg-ob [data-testid^="grade-select-"] {
  border-width: 3px !important; border-radius: 24px !important; padding: 14px 10px 12px !important;
  box-shadow: 0 5px 0 rgba(46, 16, 101, .14) !important; transition: transform .12s ease, box-shadow .12s ease !important;
}
[role="dialog"].lg-ob [data-testid^="grade-select-"]:active { transform: translateY(3px) !important; box-shadow: 0 2px 0 rgba(46, 16, 101, .14) !important; }
[role="dialog"].lg-ob [data-testid^="grade-select-"] .text-base { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 600; font-size: 19px !important; color: #2e1065 !important; }
[role="dialog"].lg-ob [data-testid^="grade-select-"] .text-\[11px\] { font-size: 12.5px !important; font-weight: 800 !important; }
[role="dialog"].lg-ob [data-testid^="grade-select-"] .absolute { font-family: 'Fredoka', 'Nunito', sans-serif; font-size: 24px !important; }

/* Gem cards */
[role="dialog"].lg-ob [data-testid^="gem-select-"] {
  min-height: 66px; padding: 10px 14px !important; border-width: 3px !important; border-radius: 22px !important;
  background-color: #fff; box-shadow: 0 4px 0 rgba(46, 16, 101, .12) !important; border-color: #e4dcf7;
  transition: transform .12s ease, box-shadow .12s ease !important;
}
[role="dialog"].lg-ob [data-testid^="gem-select-"].shadow-md { box-shadow: 0 5px 0 rgba(46, 16, 101, .22), 0 0 0 5px rgba(250, 204, 21, .55) !important; }
[role="dialog"].lg-ob [data-testid^="gem-select-"]:active { transform: translateY(3px) !important; }
[role="dialog"].lg-ob [data-testid^="gem-select-"] .font-extrabold { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 600 !important; font-size: 20px !important; }
[role="dialog"].lg-ob [data-testid^="gem-select-"] .text-xs { font-size: 14px !important; font-weight: 700; color: #6b5a9a !important; }
[role="dialog"].lg-ob[data-lgstep="gem"] .grid.grid-cols-1 { gap: 10px !important; }

/* "I'm a Ruby! Let's go!" */
[role="dialog"].lg-ob [data-testid="button-start"] {
  height: 62px !important; border-radius: 999px !important; border: 0 !important; color: #fff !important;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .28) !important; font-family: 'Fredoka', 'Nunito', sans-serif;
  font-size: 21px !important; font-weight: 600 !important; white-space: normal !important; line-height: 1.1;
  transition: transform .12s ease, box-shadow .12s ease;
}
[role="dialog"].lg-ob [data-testid="button-start"]:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .28) !important; }

/* Back */
[role="dialog"].lg-ob [data-testid^="button-back"] {
  min-height: 48px !important; border-radius: 999px !important; background: #fff !important; color: #6d28d9 !important;
  border: 2px solid #ddd6fe !important; font-weight: 900 !important; font-size: 16px !important; box-shadow: 0 3px 0 #ddd6fe;
}

/* First-time tutorial card */
.lg-tut-bg { background: rgba(46, 16, 101, .72) !important; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.lg-tut { border-radius: 32px !important; border: 4px solid #fff; box-shadow: 0 10px 0 #c4b5fd, 0 24px 60px rgba(46, 16, 101, .45) !important; background: #f5f0ff !important; }
.lg-tut > div:first-child { background: linear-gradient(135deg, #a855f7, #7c3aed 55%, #6d28d9) !important; }
.lg-tut h2 { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 600 !important; font-size: 26px !important; color: #4c1d95; }
.lg-tut p { font-size: 16px !important; font-weight: 700; color: #5b3f99 !important; }
.lg-tut .flex.gap-2 > button { height: 58px !important; border-radius: 999px !important; border: 0 !important; background: #facc15 !important; color: #3b0764 !important; box-shadow: 0 6px 0 #d9a406 !important; font-family: 'Fredoka', 'Nunito', sans-serif; font-size: 22px !important; font-weight: 600 !important; }
.lg-tut .flex.gap-2 > button:active { transform: translateY(4px); box-shadow: 0 2px 0 #d9a406 !important; }
.lg-tut .h-2.rounded-full.bg-green-500 { background: #7c3aed !important; }
.lg-tut .h-2.rounded-full.bg-gray-300 { background: #d8ccf5 !important; }
.lg-tut-skip { min-height: 44px; font-size: 15px !important; font-weight: 800; color: #6d28d9 !important; }

@media (prefers-reduced-motion: reduce) {
  .lg-ob-say.talking svg { animation: none; }
}
/* layout fixes */
[role="dialog"].lg-ob { grid-template-columns: minmax(0, 1fr) !important; }
[role="dialog"].lg-ob > * { min-width: 0; }
.lg-ob-head { padding-right: 60px; }
.lg-ob-steps { min-width: 0; flex-wrap: nowrap; }
[role="dialog"].lg-ob[data-lgstep="name"] h2 { font-size: clamp(24px, 6.4vw, 30px) !important; }
@media (max-width: 560px) {
  [role="dialog"].lg-ob { padding: 14px 14px 18px !important; gap: 12px !important; }
  [role="dialog"].lg-ob [data-testid^="grade-select-"] { padding: 10px 8px 10px !important; gap: 2px !important; }
  [role="dialog"].lg-ob [data-testid^="grade-select-"] > svg { width: 38px !important; height: 38px !important; }
  [role="dialog"].lg-ob[data-lgstep="grade"] .grid.grid-cols-2 { gap: 10px !important; }
  [role="dialog"].lg-ob[data-lgstep="gem"] .grid.grid-cols-1 { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  [role="dialog"].lg-ob[data-lgstep="gem"] .grid.grid-cols-1 > button:last-child { grid-column: 1 / -1; justify-self: center; width: calc(50% - 5px); }
  [role="dialog"].lg-ob [data-testid^="gem-select-"] { gap: 8px !important; padding: 8px 10px !important; min-height: 60px; }
  [role="dialog"].lg-ob [data-testid^="gem-select-"] > svg:last-child { display: none; }
  [role="dialog"].lg-ob [data-testid^="gem-select-"] > svg:first-child { width: 30px; height: 30px; flex: 0 0 auto; }
  [role="dialog"].lg-ob [data-testid^="gem-select-"] .font-extrabold { font-size: 18px !important; }
  [role="dialog"].lg-ob [data-testid^="gem-select-"] .text-xs { font-size: 12.5px !important; line-height: 1.2; }
}
@media (max-width: 560px) {
  [role="dialog"].lg-ob [data-testid^="gem-select-"] { min-width: 0 !important; }
  [role="dialog"].lg-ob [data-testid^="gem-select-"] > svg:last-child { display: none !important; }
  [role="dialog"].lg-ob [data-testid^="gem-select-"] > .flex-1 { min-width: 0; }
}
@media (max-width: 430px) { .lg-ob-steps li .t { display: none; } .lg-ob-steps li { padding: 5px 8px; } }
@media (max-width: 360px) { [role="dialog"].lg-ob [data-testid^="gem-select-"] .font-extrabold { font-size: 16px !important; } }
/* contrast + wrap fixes */
[role="dialog"].lg-ob [data-testid^="grade-select-"] .text-\[11px\] { white-space: nowrap; filter: brightness(.72) saturate(1.2); }
@media (max-width: 430px) { [role="dialog"].lg-ob [data-testid^="grade-select-"] .text-\[11px\] { font-size: 11.5px !important; letter-spacing: -.01em; } }
[role="dialog"].lg-ob [data-testid^="gem-select-"] .text-xs { color: #4b3f72 !important; }
.lg-tut .h-2.rounded-full.bg-gray-300 { background: #a99bd0 !important; }
@media (max-width: 360px) { [role="dialog"].lg-ob [data-testid^="grade-select-"] .text-\[11px\] { white-space: normal; text-align: center; } }

/* ===== Shiny tutorial header (the sparkle / rocket / gem picture) ===== */
.lg-tut > div:first-child { position: relative; overflow: hidden; isolation: isolate; }
.lg-tut > div:first-child::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 50% 55%, rgba(255, 255, 255, .55) 0 18%, rgba(253, 230, 138, .35) 30%, transparent 58%),
    radial-gradient(circle at 18% 28%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 82% 22%, #fff 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 74% 78%, #fde68a 0 2px, transparent 3px),
    radial-gradient(circle at 26% 76%, #fff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 90% 55%, #fff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 10% 52%, #fde68a 0 2px, transparent 3px);
  animation: lgTwinkle 2.4s ease-in-out infinite alternate;
}
.lg-tut > div:first-child::after {
  content: ""; position: absolute; top: -30%; bottom: -30%; width: 38%; left: -60%; z-index: 2; pointer-events: none;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, .7) 50%, rgba(255, 255, 255, 0) 80%, transparent 100%);
  transform: skewX(-18deg); animation: lgSweep 3.2s ease-in-out infinite;
}
.lg-tut > div:first-child > span {
  position: relative; z-index: 1; display: inline-block;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, .95)) drop-shadow(0 0 22px rgba(253, 224, 71, .9)) drop-shadow(0 4px 0 rgba(76, 29, 149, .35));
  animation: lgShine 1.8s ease-in-out infinite alternate !important;
}
@keyframes lgShine { from { transform: scale(1) rotate(-4deg); } to { transform: scale(1.12) rotate(4deg); } }
@keyframes lgSweep { 0% { left: -60%; } 55%, 100% { left: 130%; } }
@keyframes lgTwinkle { from { opacity: .75; } to { opacity: 1; filter: brightness(1.25); } }
.lg-tut .flex.gap-2 > button:first-child:not(:last-child) { background: #fff !important; color: #6d28d9 !important; border: 2px solid #ddd6fe !important; box-shadow: 0 4px 0 #ddd6fe !important; }

/* ===== Dashboard, restyled to match the landing page ===== */
html.lg-dash #root .min-h-screen > .fixed.inset-0.-z-10 > div:first-child { background: linear-gradient(180deg, #f5f0ff 0%, #ede4fe 45%, #e9ddff 100%) !important; }
html.lg-dash #root main { padding-top: 18px !important; padding-bottom: 48px !important; }
html.lg-dash #root main h1, html.lg-dash #root main h2, html.lg-dash #root main h3 { font-family: 'Fredoka', 'Nunito', sans-serif !important; font-weight: 600 !important; letter-spacing: 0 !important; }

/* Gem identity bar */
html.lg-dash #root main > div.rounded-2xl.border:first-child {
  border-width: 3px !important; border-radius: 24px !important; padding: 12px 16px !important;
  box-shadow: 0 5px 0 rgba(46, 16, 101, .14); background-color: #fff;
}
html.lg-dash #root main > div.rounded-2xl.border:first-child .font-extrabold { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 600 !important; font-size: 20px !important; }
html.lg-dash #root main > div.rounded-2xl.border:first-child .text-xs { font-size: 14px !important; font-weight: 700; color: #4b3f72 !important; }
html.lg-dash #root main > div.rounded-2xl.border:first-child svg { width: 42px; height: 42px; filter: drop-shadow(0 0 8px rgba(255,255,255,.9)); }

/* Greeting */
html.lg-dash #root main section.text-center h1 { font-size: clamp(32px, 8vw, 46px) !important; line-height: 1.08 !important; padding: 4px 0; }
html.lg-dash #root [data-testid="button-invite"] { min-height: 48px; font-weight: 900 !important; font-size: 16px !important; border-width: 3px !important; box-shadow: 0 4px 0 #c4b5fd; }
html.lg-dash #root [data-testid="button-invite"]:active { transform: translateY(3px); box-shadow: 0 1px 0 #c4b5fd; }

/* Today's Adventure */
html.lg-dash #root [data-testid="daily-adventure"] {
  border-radius: 32px !important; border: 4px solid #fff; padding: 18px !important;
  background: linear-gradient(135deg, #a855f7, #7c3aed 55%, #6d28d9) !important;
  box-shadow: 0 8px 0 #5b21b6, 0 18px 40px rgba(76, 29, 149, .25) !important;
}
html.lg-dash #root [data-testid="daily-adventure"] h2 { font-size: clamp(22px, 5.6vw, 28px) !important; line-height: 1.15 !important; }
html.lg-dash #root [data-testid="daily-adventure"] .tracking-widest { color: #fde68a !important; font-size: 12.5px !important; font-weight: 900 !important; }
html.lg-dash #root [data-testid="daily-adventure"] .bg-white\/15 { background: #facc15 !important; color: #3b0764; box-shadow: 0 4px 0 #d9a406; }
html.lg-dash #root [data-testid="daily-adventure"] .bg-white\/15 p { color: #3b0764 !important; }
html.lg-dash #root [data-testid^="daily-"]:not([data-testid="daily-adventure"]) {
  border-radius: 22px !important; padding: 12px 14px !important; min-height: 72px;
  box-shadow: 0 5px 0 rgba(46, 16, 101, .35) !important;
}
html.lg-dash #root [data-testid^="daily-"]:not([data-testid="daily-adventure"]) > div:first-child { width: 52px !important; height: 52px !important; border-radius: 16px !important; font-size: 28px !important; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); }
html.lg-dash #root [data-testid^="daily-"]:not([data-testid="daily-adventure"]) .font-extrabold { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 600 !important; font-size: 19px !important; color: #2e1065; }
html.lg-dash #root [data-testid^="daily-"]:not([data-testid="daily-adventure"]) .uppercase { font-size: 12px !important; font-weight: 900 !important; color: #6b5a9a !important; }
html.lg-dash #root [data-testid="daily-adventure"] > p:last-child { font-size: 14px !important; font-weight: 800 !important; color: #fff !important; }

/* Mascot glow */
html.lg-dash #root main section.text-center img[src*="mascot"] { filter: drop-shadow(0 0 18px rgba(255, 255, 255, .95)) drop-shadow(0 8px 14px rgba(124, 58, 237, .3)); }
html.lg-dash #root main section.text-center > p.text-muted-foreground { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 600; font-size: 19px !important; color: #4c1d95 !important; }

/* Grade pills */
html.lg-dash #root [data-testid^="grade-pill-"] {
  min-height: 44px; padding: 0 16px !important; font-size: 15px !important; font-weight: 900 !important;
  background: #fff !important; color: #5b3f99 !important; border: 2px solid #ddd6fe !important; box-shadow: 0 3px 0 #ddd6fe !important;
}
html.lg-dash #root [data-testid^="grade-pill-"].bg-gradient-to-r { background: #7c3aed !important; color: #fff !important; border-color: #7c3aed !important; box-shadow: 0 4px 0 #5b21b6 !important; }
html.lg-dash #root [data-testid^="grade-pill-"]:active { transform: translateY(2px); }

/* Subject worlds */
html.lg-dash #root [data-testid^="card-subject-"] {
  border-radius: 30px !important; border: 4px solid #fff !important; overflow: hidden;
  box-shadow: 0 8px 0 var(--lgd, #7c3aed), 0 16px 30px rgba(46, 16, 101, .18) !important; transition: transform .14s ease, box-shadow .14s ease !important;
}
html.lg-dash #root [data-testid="card-subject-reading"] { --lgd: #be123c; }
html.lg-dash #root [data-testid="card-subject-math"] { --lgd: #1d4ed8; }
html.lg-dash #root [data-testid="card-subject-science"] { --lgd: #047857; }
html.lg-dash #root [data-testid^="card-subject-"]:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--lgd, #7c3aed) !important; }
html.lg-dash #root [data-testid^="card-subject-"] h2 { font-size: 28px !important; margin-top: 10px !important; }
html.lg-dash #root [data-testid^="card-subject-"] h2 + p { font-size: 15px !important; font-weight: 700; opacity: .95 !important; }
html.lg-dash #root [data-testid^="card-subject-"] img { filter: drop-shadow(0 0 12px rgba(255, 255, 255, .7)) drop-shadow(0 6px 8px rgba(0, 0, 0, .2)); }
html.lg-dash #root [data-testid^="card-subject-"] > div:last-child { padding: 12px 16px !important; }
html.lg-dash #root [data-testid^="card-subject-"] > div:last-child .text-xs { font-size: 14px !important; font-weight: 800; color: #4b3f72 !important; }

/* OT Fun Zone + daily challenge banners */
html.lg-dash #root [data-testid="card-ot-entry"] { border-radius: 28px !important; border: 4px solid #fff !important; box-shadow: 0 7px 0 #c2410c, 0 14px 28px rgba(46, 16, 101, .16) !important; }
html.lg-dash #root main > a > div.relative.overflow-hidden.rounded-2xl { border-radius: 28px !important; border: 4px solid #fff; padding: 16px 18px !important; box-shadow: 0 7px 0 rgba(46, 16, 101, .3), 0 14px 28px rgba(46, 16, 101, .16) !important; }
html.lg-dash #root main > a > div.relative.overflow-hidden.rounded-2xl .font-extrabold { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 600 !important; font-size: 21px !important; }
html.lg-dash #root main > a > div.relative.overflow-hidden.rounded-2xl .uppercase { font-size: 12.5px !important; font-weight: 900 !important; }
html.lg-dash #root main > a > div.relative.overflow-hidden.rounded-2xl .text-\[11px\] { font-size: 13px !important; font-weight: 800 !important; }

/* Quick links (Gem Shop, Parents, Teacher...) */
html.lg-dash #root main > section.grid.grid-cols-2 > a > div {
  min-height: 70px; border-radius: 22px !important; border-width: 3px !important; padding: 12px !important;
  background: #fff !important; box-shadow: 0 5px 0 rgba(46, 16, 101, .12) !important; transition: transform .12s ease, box-shadow .12s ease;
}
html.lg-dash #root main > section.grid.grid-cols-2 > a > div:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(46, 16, 101, .12) !important; }
html.lg-dash #root main > section.grid.grid-cols-2 > a > div .font-semibold { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 600 !important; font-size: 16.5px !important; color: #2e1065; line-height: 1.15; }
html.lg-dash #root main > section.grid.grid-cols-2 > a > div .text-\[10px\] { font-size: 12.5px !important; font-weight: 700; color: #4b3f72 !important; }
html.lg-dash #root main > section.grid.grid-cols-2 > a > div > svg, html.lg-dash #root main > section.grid.grid-cols-2 > a > div > span { width: 26px; height: 26px; font-size: 24px !important; flex: 0 0 auto; }

/* Activities for You */
html.lg-dash #root main > section > h3 { font-size: 26px !important; color: #4c1d95 !important; margin-bottom: 14px !important; }
html.lg-dash #root main > section > h3 svg { width: 26px; height: 26px; color: #eab308; }
html.lg-dash #root [data-testid^="card-activity-"] {
  border-radius: 24px !important; border-width: 3px !important; padding: 14px !important;
  box-shadow: 0 5px 0 rgba(46, 16, 101, .13) !important; transition: transform .12s ease, box-shadow .12s ease !important;
}
html.lg-dash #root [data-testid^="card-activity-"]:active { transform: translateY(3px) !important; box-shadow: 0 2px 0 rgba(46, 16, 101, .13) !important; }
html.lg-dash #root [data-testid^="card-activity-"] > span:first-child { font-size: 40px !important; filter: drop-shadow(0 3px 0 rgba(46, 16, 101, .12)); }
html.lg-dash #root [data-testid^="card-activity-"] > p.font-semibold { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 600 !important; font-size: 18px !important; color: #2e1065; line-height: 1.15; }
html.lg-dash #root [data-testid^="card-activity-"] .text-\[10px\] { font-size: 12.5px !important; font-weight: 700; }
html.lg-dash #root [data-testid^="card-activity-"] p.text-muted-foreground { color: #4b3f72 !important; line-height: 1.35; }

@media (prefers-reduced-motion: reduce) {
  .lg-tut > div:first-child::after, .lg-tut > div:first-child::before, .lg-tut > div:first-child > span { animation: none !important; }
}
.lg-tut .h-2.rounded-full { background: #c4b5fd !important; }
.lg-tut .h-2.rounded-full.w-6 { background: #7c3aed !important; }
html.lg-dash #root main > section.grid > a { display: block; }
html.lg-dash #root main > section.grid > a > [data-testid^="card-subject-"] { height: 100%; display: flex; flex-direction: column; }
html.lg-dash #root main > section.grid > a > [data-testid^="card-subject-"] > div:first-child { flex: 1 1 auto; }
/* Shortcut cards: keep long words like "Leaderboard" inside the card on narrow phones */
html.lg-dash #root main > section.grid.grid-cols-2 > a { min-width: 0; }
html.lg-dash #root main > section.grid.grid-cols-2 > a > div { min-width: 0; overflow: hidden; gap: 8px !important; }
html.lg-dash #root main > section.grid.grid-cols-2 > a > div > div { min-width: 0; flex: 1 1 auto; }
html.lg-dash #root main > section.grid.grid-cols-2 > a > div .font-semibold { overflow-wrap: anywhere; hyphens: auto; }
@media (max-width: 400px) {
  html.lg-dash #root main > section.grid.grid-cols-2 { gap: 10px !important; }
  html.lg-dash #root main > section.grid.grid-cols-2 > a > div { padding: 10px !important; }
  html.lg-dash #root main > section.grid.grid-cols-2 > a > div .font-semibold { font-size: 15px !important; }
  html.lg-dash #root main > section.grid.grid-cols-2 > a > div .text-\[10px\] { font-size: 12px !important; }
  html.lg-dash #root main > section.grid.grid-cols-2 > a > div > svg, html.lg-dash #root main > section.grid.grid-cols-2 > a > div > span { width: 22px !important; height: 22px !important; font-size: 20px !important; }
}
@media (max-width: 350px) {
  html.lg-dash #root main > section.grid.grid-cols-2 > a > div { flex-direction: column; align-items: flex-start !important; gap: 4px !important; }
  html.lg-dash #root main > section.grid.grid-cols-2 > a > div .font-semibold { overflow-wrap: normal; hyphens: none; font-size: 14.5px !important; }
}

/* ===== Dashboard layout fixes, round 2 ===== */
/* Header sound buttons were gray on purple; make them readable */
html.lg-dash #root header button.text-muted-foreground { color: #fff !important; opacity: .92; }
html.lg-dash #root header button.text-muted-foreground:hover { background: rgba(255, 255, 255, .18) !important; }
/* Today's Adventure: never cut game names off with "..." */
html.lg-dash #root [data-testid^="daily-"]:not([data-testid="daily-adventure"]) .truncate { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; line-height: 1.15; }
@media (min-width: 640px) and (max-width: 900px) {
  html.lg-dash #root [data-testid^="daily-"]:not([data-testid="daily-adventure"]) .font-extrabold { font-size: 17px !important; }
  html.lg-dash #root [data-testid^="daily-"]:not([data-testid="daily-adventure"]) > div:first-child { width: 46px !important; height: 46px !important; font-size: 24px !important; }
}
/* Shortcut grid: a lone last card (Glossary) is centered instead of left hanging */
html.lg-dash #root main > section.grid.grid-cols-2 > a:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc((100% - 10px) / 2); }
@media (min-width: 640px) {
  html.lg-dash #root main > section.grid.grid-cols-2 > a:last-child:nth-child(odd) { width: auto; justify-self: stretch; grid-column: auto; }
  html.lg-dash #root main > section.grid.grid-cols-2 > a:last-child:nth-child(4n+1) { grid-column: 1 / -1; justify-self: center; width: calc((100% - 36px) / 4); }
}
/* Grade pills fit in two rows on small phones */
@media (max-width: 360px) {
  html.lg-dash #root [data-testid^="grade-pill-"] { padding: 0 12px !important; font-size: 14px !important; }
  html.lg-dash #root main section.text-center .flex-wrap { gap: 6px !important; }
}
html.lg-dash #root [data-testid^="grade-pill-"] { min-width: 44px; }
/* Equal-height cards in each row */
html.lg-dash #root main > section.grid.grid-cols-2 > a { display: block; }
html.lg-dash #root main > section.grid.grid-cols-2 > a > div { height: 100%; }
html.lg-dash #root main > section > .grid > a { display: block; min-width: 0; }
html.lg-dash #root main > section > .grid > a > [data-testid^="card-activity-"] { height: 100%; }

/* "From your teacher" card on the child's dashboard */
.lg-tasks { text-align: left; margin: 0 0 18px; padding: 16px; border-radius: 28px; background: #fff7d6; border: 4px solid #fff; box-shadow: 0 7px 0 #e9b949, 0 14px 30px rgba(46, 16, 101, .14); color: #3b0764; font-family: 'Nunito', system-ui, sans-serif; }
.lg-tasks-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.lg-tasks .k { margin: 0; font-size: 12.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #a16207; }
.lg-tasks h2 { margin: 2px 0 0; font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 600; font-size: clamp(22px, 5.6vw, 26px); line-height: 1.15; color: #4c1d95; }
.lg-tasks-badge { flex: 0 0 auto; min-width: 56px; padding: 8px 10px; border-radius: 18px; background: #7c3aed; color: #fff; text-align: center; font-weight: 900; font-size: 18px; box-shadow: 0 4px 0 #5b21b6; }
.lg-tasks-list { display: grid; gap: 10px; }
@media (min-width: 640px) { .lg-tasks-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lg-task { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px; border: 0; border-radius: 20px; background: #fff; color: #2e1065; text-align: left; box-shadow: 0 5px 0 rgba(161, 98, 7, .28); cursor: pointer; font: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.lg-task:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(161, 98, 7, .28); }
.lg-task .ic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: #facc15; color: #7c3aed; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12); font-size: 22px; font-weight: 900; }
.lg-task .ic svg { width: 26px; height: 26px; }
.lg-task .tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.lg-task b { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 600; font-size: 18px; line-height: 1.15; }
.lg-task small { font-size: 13px; font-weight: 800; color: #6b5a9a; }
.lg-task .go { flex: 0 0 auto; font-size: 28px; font-weight: 900; color: #a78bfa; }
.lg-task.done { background: #ecfdf5; box-shadow: 0 5px 0 rgba(4, 120, 87, .25); }
.lg-task.done .ic { background: #10b981; color: #fff; }
.lg-task.done b { color: #065f46; }

/* Teacher Portal: keep the class name visible on small phones, clearer progress bars */
html.lg-teach #root header > div > div:first-child { display: flex !important; min-width: 0; flex-shrink: 1; }
html.lg-teach #root header > div > div:first-child > div:last-child { min-width: 0; }
html.lg-teach #root header > div > div:first-child p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.lg-teach #root header > div > button { flex-shrink: 0; }
@media (max-width: 420px) {
  html.lg-teach #root header > div { gap: 8px; padding-left: 10px; padding-right: 6px; }
  html.lg-teach #root header > div > div:first-child > div:first-child { display: none; }
  html.lg-teach #root header > div > button span { font-size: 13px; }
}
html.lg-teach #root [role="progressbar"] { background-color: #ede9fe !important; }
html.lg-teach #root [role="progressbar"] > div { background-color: #7c3aed !important; }
html.lg-teach #root .grid-cols-3 > div { min-width: 0; }
html.lg-teach #root .grid-cols-3 > div p { overflow-wrap: anywhere; }

/* Join my class */
.lg-join { text-align: left; margin: 0 0 16px; }
.lg-join > button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 16px; border: 3px dashed #c4b5fd; border-radius: 22px; background: #fff; color: #3b0764; font: inherit; font-family: 'Nunito', system-ui, sans-serif; cursor: pointer; text-align: left; }
.lg-join.in > button { border-style: solid; border-color: #ddd6fe; background: #f5f3ff; }
.lg-join .ic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: #ede9fe; color: #7c3aed; font-size: 24px; }
.lg-join .ic svg { width: 24px; height: 24px; }
.lg-join .tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.lg-join small { font-size: 13px; font-weight: 800; color: #6b5a9a; }
.lg-join b { font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 600; font-size: 19px; line-height: 1.15; color: #5b21b6; overflow-wrap: anywhere; }
.lg-join .go { font-size: 28px; font-weight: 900; color: #a78bfa; }
.lg-jm-bg { position: fixed; inset: 0; z-index: 2147483000; background: rgba(46, 16, 101, .55); display: grid; place-items: center; padding: 16px; font-family: 'Nunito', system-ui, sans-serif; }
.lg-jm { width: min(400px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 28px; border: 4px solid #fff; box-shadow: 0 8px 0 #c4b5fd, 0 24px 60px rgba(46, 16, 101, .35); padding: 0 20px 20px; text-align: center; color: #2e1065; }
.lg-jm-top { margin: 0 -20px 16px; padding: 22px 20px 18px; border-radius: 24px 24px 0 0; background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: #fff; }
.lg-jm-top.ok { background: linear-gradient(135deg, #10b981, #047857); }
.lg-jm-top .big { font-size: 44px; line-height: 1; display: block; }
.lg-jm-top h2 { margin: 8px 0 4px; font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 600; font-size: 26px; color: #fff; }
.lg-jm-top p { margin: 0; font-weight: 700; color: #f5f3ff; }
.lg-jm input { width: 100%; height: 64px; border-radius: 18px; border: 3px solid #c4b5fd; text-align: center; font-family: 'Fredoka', 'Nunito', sans-serif; font-size: 32px; letter-spacing: .25em; text-transform: uppercase; color: #4c1d95; background: #faf5ff; }
.lg-jm input:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 4px rgba(124, 58, 237, .2); }
.lg-jm .err { margin: 10px 0 0; color: #b91c1c; font-weight: 800; }
.lg-jm .note { margin: 12px 0 0; font-size: 14px; color: #5b4b8a; }
.lg-jm-go { display: block; width: 100%; min-height: 56px; margin-top: 16px; border: 0; border-radius: 18px; background: #facc15; color: #3b0764; font-family: 'Fredoka', 'Nunito', sans-serif; font-weight: 600; font-size: 22px; box-shadow: 0 5px 0 #ca8a04; cursor: pointer; }
.lg-jm-go:disabled { opacity: .7; }
.lg-jm-link { display: block; width: 100%; min-height: 44px; margin-top: 8px; border: 0; background: none; color: #6d28d9; font-weight: 800; font-size: 15px; cursor: pointer; }
.lg-jm .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Teacher password reset */
.lg-forgot { display: block; width: 100%; min-height: 44px; margin-top: 4px; border: 0; background: none; color: #6d28d9; font-weight: 800; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.lg-rs { text-align: left; }
.lg-rs .lg-jm-top { text-align: center; }
.lg-rs-l { display: block; margin: 12px 0 6px; font-weight: 800; font-size: 14px; color: #4c1d95; }
.lg-rs-in { width: 100%; height: 52px; padding: 0 14px; border-radius: 14px; border: 3px solid #c4b5fd; background: #faf5ff; font-size: 17px; color: #2e1065; font-family: 'Nunito', system-ui, sans-serif; }
.lg-rs-in.code { text-align: center; font-family: 'Fredoka', 'Nunito', sans-serif; font-size: 28px; letter-spacing: .3em; }
.lg-rs-in:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 4px rgba(124, 58, 237, .2); }
.lg-rs .note { text-align: center; }
.lg-rs .note a { color: #6d28d9; font-weight: 800; overflow-wrap: anywhere; }
.lg-rs .err { text-align: center; }
.lg-rs .lg-jm-top { padding: 16px 20px 14px; }
.lg-rs .lg-jm-top .big { font-size: 34px; }
.lg-rs .lg-jm-top h2 { font-size: 23px; }
@media (max-height: 700px) { .lg-rs .lg-jm-top .big { display: none; } }

.lg-del { display: flex; justify-content: center; padding: 28px 16px 40px; }
.lg-del button { min-height: 44px; padding: 8px 18px; border: 0; background: none; color: #b91c1c; font: 700 15px Nunito, system-ui, sans-serif; text-decoration: underline; cursor: pointer; }
.lg-del-top { background: linear-gradient(135deg, #dc2626, #991b1b) !important; }
.lg-jm .lg-del-go { background: #dc2626 !important; color: #fff !important; box-shadow: 0 5px 0 #991b1b !important; }
.lg-jm-x2 { display: block; width: 100%; min-height: 44px; margin-top: 10px; border: 0; background: none; color: #5b21b6; font: 800 16px Nunito, system-ui, sans-serif; text-decoration: underline; cursor: pointer; }

.lg3-trust{list-style:none;display:flex;flex-wrap:wrap;justify-content:center;gap:8px 10px;margin:26px auto 0;padding:0;max-width:820px}
.lg3-trust li{display:flex;align-items:center;gap:6px;background:#fff;border:2px solid #ede9fe;border-radius:999px;padding:8px 14px;font-weight:800;font-size:14px;color:#4c1d95}
.lg3-trust li::before{content:"";width:16px;height:16px;border-radius:50%;background:#7c3aed url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;flex:none}
.lg3-about{display:flex;gap:18px;align-items:flex-start;max-width:820px;margin:22px auto 0;background:#fff;border:2px solid #ede9fe;border-radius:24px;padding:20px 22px;box-shadow:0 6px 18px rgba(76,29,149,.08);text-align:left}
.lg3-about img{width:84px;height:84px;object-fit:contain;flex:none}
.lg3-about h3{margin:0 0 6px;font-family:Fredoka,system-ui,sans-serif;font-size:20px;color:#3b0764}
.lg3-about p{margin:0 0 8px;font-size:15px;line-height:1.55;color:#3f3d56;font-weight:600}
.lg3-about .lg3-help{margin:0;font-size:14px}
.lg3-about a{color:#6d28d9;font-weight:900;display:inline-flex;align-items:center;min-height:44px;padding:0 2px}
@media (max-width:560px){.lg3-about{flex-direction:column;align-items:center;text-align:center}}
.lg2-world .lbl { background: var(--d); border-radius: 0 0 22px 22px; margin: 8px -8px -8px; padding: 12px 10px 12px 14px; }
.lg2-world .pic.icon { display: grid; place-items: center; background: rgba(255, 255, 255, .28); }
.lg2-world .pic.icon img { width: 72%; height: 82%; object-fit: contain; }
