:root {
  --ink: #174a73;
  --paper: #fff4cf;
  --white: #ffffff;
  --yellow: #ffc914;
  --blue: #3f71b5;
  --cyan: #28bdb5;
  --coral: #db4d45;
  --green: #21836e;
  --purple: #aa55cf;
  --orange: #ff8147;
  --muted: #526b7d;
  --line: #d8e3e8;
  --soft-blue: #e6f7f4;
  --radius: 28px;
  --shadow: 0 12px 30px rgba(23,74,115,.16);
  --z-base: 0;
  --z-header: 10;
  --z-sidebar: 20;
  --z-dialog: 30;
  --z-toast: 40;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body { margin: 0; overflow-x: clip; background: var(--paper); color: var(--ink); font-family: "Noto Kufi Arabic", sans-serif; text-wrap: pretty; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img, video { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-family: "Baloo Bhaijaan 2", sans-serif; line-height: 1.08; text-wrap: balance; }
p { text-wrap: pretty; }
em { color: var(--coral); font-style: normal; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: var(--z-toast); inset: 8px auto auto 8px; padding: 10px 14px; background: var(--ink); color: var(--white); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.site-header { position: sticky; top: 0; z-index: var(--z-header); min-height: 86px; padding: 8px clamp(18px,5vw,72px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; border-bottom: 0; background: rgba(255,255,255,.97); box-shadow: 0 5px 24px rgba(23,74,115,.12); }
.brand { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; font: 800 22px "Baloo Bhaijaan 2", sans-serif; text-decoration: none; }
.brand-mark { min-width: 50px; height: 44px; padding: 0 8px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 12px; background: var(--yellow); direction: ltr; }
.brand-mark b { color: var(--coral); }
.shamsita-brand { width: 230px; }
.brand-logo-frame { position: relative; width: 230px; height: 74px; overflow: hidden; display: block; flex: 0 0 auto; background: var(--white); }
.brand-logo-frame img { position: absolute; top: -99px; left: -18px; width: 260px; height: auto; max-width: none; }
.site-header nav { display: flex; gap: 28px; }
.site-header nav a { min-height: 44px; display: grid; place-items: center; font-size: 13px; font-weight: 800; text-decoration: none; }
.site-header nav a:hover { text-decoration: underline 3px var(--yellow); text-underline-offset: 7px; }
.account-slot { justify-self: end; }

.button { min-height: 48px; padding: 10px 22px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 999px; background: var(--white); color: var(--ink); font-weight: 800; text-decoration: none; box-shadow: 0 5px 0 #b8cbd7; transition: transform 160ms ease-out, box-shadow 160ms ease-out; }
.button:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #b8cbd7; }
.button:active { transform: translateY(3px); box-shadow: 0 2px 0 #b8cbd7; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button:focus-visible, .icon-button:focus-visible, a:focus-visible, .episode-nav-item:focus-visible { outline: 4px solid var(--cyan); outline-offset: 3px; }
.button-primary { background: var(--yellow); box-shadow: 0 5px 0 #d79c00; }
.button-dark { background: var(--blue); color: var(--white); box-shadow: 0 5px 0 #244f88; }
.button-auth { background: var(--white); font-size: 13px; }
.button-wide { width: 100%; margin-block: 20px 10px; }
.login-symbol { width: 27px; height: 27px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; font: 800 18px sans-serif; direction: ltr; }
.icon-button { width: 48px; height: 48px; border: 2px solid var(--ink); border-radius: 50%; background: var(--white); color: var(--ink); font-size: 27px; line-height: 1; }
.text-link { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; font-weight: 800; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.eyebrow { margin: 0 0 15px; color: #34415f; font-size: 12px; font-weight: 800; }
.eyebrow span { color: var(--coral); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.hero { max-width: 1440px; min-height: 700px; margin: auto; padding: clamp(52px,7vw,96px) clamp(22px,6vw,90px); display: grid; grid-template-columns: 1.06fr .94fr; align-items: center; gap: clamp(42px,7vw,100px); }
.hero h1 { font-size: clamp(52px,6vw,88px); }
.hero-lead { max-width: 660px; margin: 24px 0 28px; color: var(--muted); font-size: clamp(16px,1.4vw,20px); line-height: 2; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.hero-facts { margin: 42px 0 0; padding: 0; display: flex; gap: clamp(24px,4vw,54px); list-style: none; }
.hero-facts li { display: grid; gap: 2px; }
.hero-facts strong { font: 800 20px "Baloo Bhaijaan 2", sans-serif; font-variant-numeric: tabular-nums; }
.hero-facts span { color: var(--muted); font-size: 11px; }
.hero-stage { position: relative; min-height: 500px; padding: 70px 48px 40px; border: 3px solid var(--ink); border-radius: 40px 40px 86px 40px; background: var(--blue); box-shadow: 13px 13px 0 var(--ink); transform: rotate(-1.5deg); }
.stage-label { position: absolute; inset: 22px 28px auto auto; padding: 8px 14px; border-radius: 10px; background: var(--yellow); font-weight: 800; transform: rotate(2deg); }
.mini-grid { width: min(100%,360px); aspect-ratio: 1; margin: auto; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; direction: ltr; }
.mini-grid span { display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 16px; background: var(--white); font: 700 44px "Baloo Bhaijaan 2", sans-serif; }
.mini-grid .star { color: #d79d00; background: #fff1a9; }
.mini-grid .rock { color: #737b8c; background: #d8dce4; transform: rotate(8deg); }
.mini-grid .mini-robot { color: var(--blue); background: #dff8ff; border-width: 4px; }
.code-strip { position: absolute; inset: auto auto -28px 34px; padding: 12px; display: flex; align-items: center; gap: 8px; border: 3px solid var(--ink); border-radius: 18px; background: var(--white); direction: ltr; transform: rotate(2deg); }
.code-strip kbd { width: 52px; height: 52px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 10px; background: #e9f0ff; font: 800 30px sans-serif; box-shadow: 0 4px 0 #b7c7e6; }
.code-strip span { padding: 10px 12px; border-radius: 10px; background: var(--yellow); font-weight: 800; direction: rtl; }
.scribble { position: absolute; inset: auto 16px 22px auto; color: var(--white); font: 700 15px "Baloo Bhaijaan 2", sans-serif; transform: rotate(-5deg); }
.course-search { max-width: 620px; margin: 28px 0 20px; padding: 5px; display: grid; grid-template-columns: 1fr auto; gap: 6px; border: 2px solid #b8d7d3; border-radius: 999px; background: var(--white); box-shadow: var(--shadow); }
.course-search input { min-width: 0; min-height: 48px; padding: 8px 14px; border: 0; background: transparent; color: var(--ink); }
.course-search input:focus { outline: 3px solid var(--cyan); border-radius: 9px; }
.course-search button { min-width: 92px; min-height: 48px; border: 0; border-radius: 999px; background: var(--cyan); color: #083f49; font-weight: 800; }
.marketplace-stage { min-height: 520px; display: grid; grid-template-columns: repeat(2,1fr); grid-template-rows: 1.3fr .8fr .55fr; gap: 14px; padding: 74px 28px 28px; background: #dceaff; transform: rotate(-1deg); }
.stage-feature { grid-column: 1 / -1; padding: 24px; display: flex; align-items: center; gap: 22px; border: 3px solid var(--ink); border-radius: 22px; background: var(--blue); color: var(--white); box-shadow: 5px 5px 0 var(--ink); }
.stage-icon { width: 100px; height: 100px; display: grid; place-items: center; flex: 0 0 auto; border: 3px solid var(--ink); border-radius: 22px; background: var(--yellow); color: var(--ink); font: 800 34px monospace; direction: ltr; }
.stage-feature div { display: grid; gap: 3px; }
.stage-feature small { color: #d8e6ff; }
.stage-feature strong { font: 800 clamp(24px,3vw,37px) "Baloo Bhaijaan 2",sans-serif; }
.stage-feature p { margin: 0; color: #e8f0ff; font-size: 12px; }
.stage-mini { padding: 17px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 12px; border: 2px solid var(--ink); border-radius: 18px; background: var(--white); box-shadow: 4px 4px 0 var(--ink); }
.stage-mini span { width: 50px; height: 50px; grid-row: 1 / span 2; display: grid; place-items: center; border-radius: 14px; background: var(--yellow); font: 800 25px sans-serif; }
.stage-mini strong { font: 800 18px "Baloo Bhaijaan 2",sans-serif; }
.stage-mini small { color: var(--muted); font-size: 9px; }
.stage-business span { background: var(--coral); color: var(--white); }
.stage-progress { grid-column: 1 / -1; padding: 12px 16px; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; border: 2px solid var(--ink); border-radius: 15px; background: var(--white); }
.stage-progress span { color: var(--muted); font-size: 10px; }
.stage-progress strong { font: 800 18px "Baloo Bhaijaan 2",sans-serif; font-variant-numeric: tabular-nums; }
.stage-progress i { grid-column: 1 / -1; width: 64%; height: 9px; justify-self: start; border: 1px solid var(--ink); border-radius: 999px; background: var(--yellow); }
.shamsita-stage { min-height: 540px; padding: 0; overflow: hidden; border: 0; border-radius: 48% 48% 22% 22% / 26% 26% 18% 18%; background: var(--cyan); box-shadow: 0 18px 0 var(--purple), var(--shadow); transform: rotate(-1deg); isolation: isolate; }
.shamsita-stage::before { content: ""; position: absolute; z-index: -1; inset: auto -8% 0; height: 48%; background: var(--purple); clip-path: polygon(0 34%,18% 8%,38% 28%,59% 3%,78% 25%,100% 7%,100% 100%,0 100%); }
.shamsita-stage::after { content: ""; position: absolute; z-index: -1; width: 260px; height: 260px; inset: -90px auto auto -70px; border-radius: 50%; background: #fff0ba; }
.sun-shape { position: absolute; inset: 20px 30px auto auto; color: var(--yellow); font: 800 100px/1 sans-serif; transform: rotate(9deg); }
.kids-friends { position: absolute; inset: auto 5% 126px; display: flex; align-items: end; justify-content: center; gap: clamp(4px,2vw,16px); direction: ltr; }
.kid-face { position: relative; width: clamp(105px,12vw,145px); aspect-ratio: .94; display: block; flex: 0 1 145px; border: 4px solid rgba(23,74,115,.22); border-radius: 48% 48% 44% 44%; background: #f5be8e; box-shadow: inset -12px -10px 0 rgba(179,90,54,.13), 0 10px 0 rgba(23,74,115,.16); }
.kid-face::before { content: ""; position: absolute; inset: -9px 15% auto; height: 30%; border-radius: 70% 70% 35% 35%; background: var(--orange); }
.kid-face i { position: absolute; width: 10px; height: 15px; inset: 46% auto auto 25%; border-radius: 50%; background: #142a3a; box-shadow: 46px 0 0 #142a3a; }
.kid-face b { position: absolute; width: 35px; height: 18px; inset: 64% auto auto 38%; border-bottom: 5px solid #142a3a; border-radius: 50%; }
.kid-one { transform: rotate(-7deg) translateY(14px); background: #f7d5bc; }
.kid-one::before { inset: -12px 20% auto; background: var(--yellow); clip-path: polygon(0 100%,12% 16%,30% 74%,49% 0,62% 70%,83% 14%,100% 100%); }
.kid-two { z-index: 2; background: #dd805b; transform: translateY(-12px); }
.kid-two::before { background: #bb3d2f; }
.kid-three { transform: rotate(7deg) translateY(12px); background: #efab72; }
.kid-three::before { inset: -14px 5% auto; height: 35%; background: #74d46b; border: 4px solid rgba(23,74,115,.18); }
.play-card { position: absolute; z-index: 3; inset: auto 8% 28px; padding: 17px 22px; display: grid; gap: 2px; border-radius: 22px; background: var(--white); box-shadow: var(--shadow); text-align: center; }
.play-card small { color: var(--coral); font-size: 9px; font-weight: 800; direction: ltr; }
.play-card strong { font: 800 clamp(24px,3vw,36px) "Baloo Bhaijaan 2",sans-serif; }
.play-card p { margin: 0; color: var(--muted); font-size: 10px; }
.doodle { position: absolute; color: var(--orange); font: 800 60px/1 sans-serif; }
.doodle-one { inset: 140px auto auto 24px; transform: rotate(80deg); }
.doodle-two { inset: 160px 25px auto auto; color: var(--white); }

.promise-strip { padding: 28px clamp(22px,7vw,110px); display: flex; justify-content: center; align-items: center; gap: clamp(20px,4vw,56px); border-block: 2px solid var(--ink); background: var(--yellow); }
.promise-strip > div { display: flex; align-items: center; gap: 13px; }
.promise-strip b { width: 46px; height: 46px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--white); font: 800 20px "Baloo Bhaijaan 2",sans-serif; }
.promise-strip span { display: grid; }
.promise-strip strong { font: 800 19px "Baloo Bhaijaan 2",sans-serif; }
.promise-strip small { font-size: 10px; }
.promise-strip i { font: 800 26px sans-serif; font-style: normal; }
.category-strip { padding: 28px clamp(22px,6vw,90px); display: flex; justify-content: center; align-items: center; gap: 30px; border-block: 0; background: var(--purple); color: var(--white); }
.category-strip > span { font: 800 19px "Baloo Bhaijaan 2",sans-serif; white-space: nowrap; }
.category-strip > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.category-strip a { min-height: 44px; padding: 9px 15px; display: inline-flex; align-items: center; border: 0; border-radius: 999px; background: var(--white); color: var(--ink); font-size: 10px; font-weight: 800; text-decoration: none; box-shadow: 0 4px 0 #773292; }
.category-strip a:hover { transform: translateY(-2px); }

.catalog { padding: 105px clamp(22px,6vw,90px); background: #fffdf7; }
.section-heading { max-width: 1280px; margin: 0 auto 52px; display: grid; grid-template-columns: 1fr minmax(280px,470px); gap: 70px; align-items: end; }
.section-heading h2 { font-size: clamp(40px,5vw,68px); }
.section-heading > p { margin: 0; color: var(--muted); line-height: 2; }
.preview-grid { max-width: 1280px; margin: auto; display: grid; grid-template-columns: repeat(2,1fr); gap: 30px; }
.preview-card { overflow: hidden; border: 3px solid var(--ink); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.preview-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-bottom: 3px solid var(--ink); }
.preview-card > div { padding: 30px; }
.episode-label { color: #36405a; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.preview-card h3 { margin-top: 8px; font-size: clamp(29px,3vw,42px); }
.preview-card p { color: var(--muted); line-height: 1.9; }
.game-tag { display: inline-block; padding: 7px 11px; border: 2px solid var(--ink); border-radius: 999px; background: var(--yellow); font-size: 11px; }
.course-market-grid { max-width: 1280px; margin: auto; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 22px; }
.course-market-card { min-width: 0; overflow: hidden; display: flex; flex-direction: column; border: 2px solid #dbe8e7; border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.course-market-card[hidden] { display: none; }
.course-market-card > img, .course-art { width: 100%; aspect-ratio: 16/10; border-bottom: 2px solid var(--ink); object-fit: cover; }
.course-art { position: relative; display: grid; place-items: center; overflow: hidden; font: 800 45px "Baloo Bhaijaan 2",sans-serif; }
.course-art span, .course-art b, .course-art i { position: absolute; width: 76px; height: 76px; display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 18px; background: var(--white); font-style: normal; }
.course-art span { transform: translate(-58px,-24px) rotate(-8deg); }
.course-art b { transform: translate(44px,28px) rotate(7deg); }
.course-art i { width: 42px; height: 42px; transform: translate(100px,-55px); font-size: 20px; }
.art-design { background: #ffdad5; }
.art-design b { background: var(--yellow); }
.art-business { background: #d7f0e1; }
.art-business span { background: #a8e1c0; }
.art-language { background: #dceaff; }
.art-language b { background: var(--yellow); }
.market-card-body { padding: 22px; display: flex; flex: 1; flex-direction: column; }
.market-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; }
.market-meta b { color: var(--green); }
.coming-course .market-meta b { color: #8b5a00; }
.market-card-body h3 { margin-top: 10px; min-height: 62px; font-size: 25px; }
.market-card-body p { color: var(--muted); font-size: 11px; line-height: 1.8; }
.market-rating { margin-top: auto; padding: 12px 0; display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); }
.market-rating span { color: #795600; font-weight: 800; font-variant-numeric: tabular-nums; }
.market-rating small { color: var(--muted); font-size: 9px; }
.market-card-body .button { width: 100%; margin-top: 6px; }
.search-empty { max-width: 1280px; margin: 30px auto 0; padding: 24px; border: 2px dashed var(--ink); border-radius: var(--radius); background: var(--paper); text-align: center; }
.learning-paths { padding: 100px clamp(22px,7vw,110px); display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(40px,8vw,120px); align-items: center; background: var(--soft-blue); }
.learning-paths h2 { font-size: clamp(38px,4.5vw,64px); }
.learning-paths ol { margin: 0; padding: 0; display: grid; list-style: none; }
.learning-paths li { min-height: 125px; padding: 18px 0; display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 18px; border-top: 2px solid var(--ink); }
.learning-paths li:last-child { border-bottom: 2px solid var(--ink); }
.learning-paths li > span { width: 52px; height: 52px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--yellow); font: 800 19px "Baloo Bhaijaan 2",sans-serif; font-variant-numeric: tabular-nums; }
.learning-paths strong { font: 800 25px "Baloo Bhaijaan 2",sans-serif; }
.learning-paths p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.my-courses-view { min-height: calc(100dvh - 216px); padding: 82px clamp(22px,6vw,90px) 110px; background: #fffaf0; }
.learning-dashboard-head { max-width: 1280px; margin: auto; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 40px; }
.learning-dashboard-head h1 { font-size: clamp(46px,6vw,78px); }
.learning-dashboard-head h1 > span { color: var(--blue); }
.learning-dashboard-head p:not(.eyebrow) { margin-bottom: 0; color: var(--muted); }
.dashboard-stats { max-width: 1280px; margin: 50px auto 80px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.dashboard-stats > div { min-height: 130px; padding: 22px; display: grid; grid-template-columns: 48px 1fr; align-items: center; column-gap: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.dashboard-stats span { width: 46px; height: 46px; grid-row: 1 / span 2; display: grid; place-items: center; border-radius: 13px; background: var(--yellow); font: 800 21px sans-serif; }
.dashboard-stats strong { align-self: end; font: 800 33px "Baloo Bhaijaan 2",sans-serif; font-variant-numeric: tabular-nums; }
.dashboard-stats small { align-self: start; color: var(--muted); font-size: 10px; }
.my-learning-section { max-width: 1280px; margin: auto; }
.enrolled-courses-list { display: grid; gap: 28px; }
.dashboard-section-title { margin-bottom: 24px; display: flex; justify-content: space-between; align-items: end; gap: 25px; }
.dashboard-section-title .eyebrow { margin-bottom: 7px; }
.dashboard-section-title h2 { font-size: clamp(38px,4vw,56px); }
.dashboard-section-title > span { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.enrolled-course-card { overflow: hidden; display: grid; grid-template-columns: minmax(330px,.8fr) 1.2fr; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.enrolled-course-cover { position: relative; min-height: 360px; border-left: 3px solid var(--ink); background: var(--soft-blue); }
.enrolled-course-cover img { width: 100%; height: 100%; object-fit: cover; }
.enrolled-course-cover > span { position: absolute; inset: 18px 18px auto auto; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--yellow); font-size: 10px; font-weight: 800; }
.enrolled-course-content { padding: clamp(28px,4vw,55px); display: flex; flex-direction: column; }
.course-provider { color: var(--blue); font-size: 11px; font-weight: 800; }
.enrolled-course-content h3 { margin-top: 8px; font-size: clamp(33px,4vw,52px); }
.enrolled-course-content > p { max-width: 620px; color: var(--muted); line-height: 1.9; }
.dashboard-progress { margin-top: auto; padding-top: 24px; }
.dashboard-progress > div:first-child { display: flex; justify-content: space-between; font-size: 11px; }
.dashboard-progress strong { font-variant-numeric: tabular-nums; }
.dashboard-progress .progress-track { height: 13px; margin-top: 10px; border: 2px solid var(--ink); background: #e2e6ee; }
.dashboard-progress .progress-track i { display: block; width: 0; height: 100%; background: var(--blue); }
.course-resume-row { margin-top: 28px; padding-top: 22px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-top: 1px solid var(--line); }
.course-resume-row > span { color: var(--muted); font-size: 10px; }
.courses-empty { max-width: 1280px; min-height: 310px; margin: auto; padding: clamp(30px,5vw,60px); display: grid; grid-template-columns: 100px 1fr auto; align-items: center; gap: 35px; border: 3px dashed var(--cyan); border-radius: var(--radius); background: var(--white); }
.empty-icon { width: 96px; height: 96px; display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 50%; background: var(--yellow); font: 700 52px sans-serif; }
.courses-empty .eyebrow { margin-bottom: 8px; }
.courses-empty h2 { font-size: clamp(32px,4vw,50px); }
.courses-empty p:not(.eyebrow) { max-width: 650px; color: var(--muted); line-height: 1.8; }
.enroll-banner { margin: 70px clamp(22px,6vw,90px) 80px; padding: clamp(30px,5vw,62px); display: flex; justify-content: space-between; align-items: center; gap: 30px; border: 0; border-radius: 42px; background: var(--orange); box-shadow: var(--shadow); }
.enroll-banner h2 { font-size: clamp(35px,4vw,58px); }
.enroll-banner p { margin-bottom: 0; }
footer { min-height: 150px; padding: 30px clamp(22px,6vw,90px); display: flex; align-items: center; justify-content: space-between; gap: 25px; background: var(--blue); color: var(--white); }
footer .brand-logo-frame { border-radius: 16px; }
footer p, footer > span { color: #c4ccdb; font-size: 11px; }

dialog { color: var(--ink); }
dialog::backdrop { background: rgba(16,24,44,.78); }
.auth-dialog, .enroll-dialog { width: min(92vw,520px); max-height: 92dvh; padding: 45px; overflow: auto; border: 0; border-radius: 34px; background: var(--white); box-shadow: 0 14px 0 var(--yellow), 0 24px 60px rgba(23,74,115,.25); text-align: center; }
.dialog-close { position: absolute; inset: 16px auto auto 16px; }
.dialog-robot { width: 82px; height: 70px; margin: 0 auto 22px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--yellow); color: var(--coral); font: 800 36px sans-serif; direction: ltr; }
.auth-dialog h2, .enroll-dialog h2 { font-size: 40px; }
.auth-dialog > p:not(.eyebrow), .enroll-dialog > p:not(.eyebrow) { color: var(--muted); line-height: 1.8; }
.auth-tabs { margin: 22px 0 18px; padding: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border: 1px solid var(--line); border-radius: 999px; background: #eef7f7; }
.auth-tabs button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; font-weight: 800; }
.auth-tabs button[aria-selected="true"] { background: var(--yellow); box-shadow: none; }
.auth-form { text-align: right; }
.auth-form label { margin-top: 12px; display: grid; gap: 6px; color: #34415f; font-size: 11px; font-weight: 800; }
.auth-form input { width: 100%; min-height: 50px; padding: 10px 14px; border: 2px solid #b7d7d3; border-radius: 16px; background: var(--white); color: var(--ink); }
.auth-form input:focus { outline: 4px solid var(--cyan); outline-offset: 2px; }
.form-note { min-height: 18px; margin-bottom: 0; color: #b3202d !important; font-size: 11px; }
.enroll-dialog-art { height: 110px; margin-bottom: 20px; display: flex; justify-content: center; align-items: center; gap: 18px; border: 3px solid var(--ink); border-radius: 20px; background: var(--blue); color: var(--white); font: 800 40px monospace; direction: ltr; }
.enroll-dialog-art span { color: var(--yellow); font-size: 58px; }
.enroll-dialog ul { padding: 0; display: grid; gap: 11px; list-style: none; text-align: right; }
.enroll-dialog li { padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; }
.enroll-dialog li span { color: var(--green); font-weight: 900; }
.enroll-price { margin-top: 20px; padding: 14px; display: flex; justify-content: space-between; align-items: center; border-block: 2px solid var(--ink); }
.enroll-price strong { font: 800 30px "Baloo Bhaijaan 2",sans-serif; color: var(--green); }

.classroom { min-height: 100dvh; display: grid; grid-template-columns: 330px minmax(0,1fr); background: #f5f7fb; direction: rtl; }
.course-sidebar { position: sticky; top: 0; z-index: var(--z-sidebar); height: 100dvh; padding: 22px; overflow-y: auto; display: flex; flex-direction: column; border-left: 0; background: var(--blue); color: var(--white); }
.course-sidebar .shamsita-brand { width: 190px; }
.course-sidebar .brand-logo-frame { width: 190px; height: 62px; border-radius: 14px; }
.course-sidebar .brand-logo-frame img { top: -83px; left: -14px; width: 215px; }
.sidebar-top { display: flex; justify-content: space-between; align-items: center; }
.sidebar-top .brand-mark { color: var(--ink); }
.sidebar-back { min-height: 44px; padding: 8px 11px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid #63708a; border-radius: 11px; background: #1c263d; color: var(--white); font-weight: 800; }
.student-card { margin-top: 35px; padding: 13px; display: flex; align-items: center; gap: 12px; border: 1px solid #38435b; border-radius: 14px; background: #1c263d; }
.student-avatar { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--yellow); color: var(--ink); font-weight: 900; }
.student-card div { min-width: 0; display: grid; }
.student-card small { color: #aeb9ce; font-size: 10px; }
.student-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-summary { padding: 30px 5px 22px; }
.course-chip { display: inline-block; padding: 5px 9px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: 10px; font-weight: 800; }
.course-summary h2 { margin-top: 13px; font-size: 28px; line-height: 1.25; }
.progress-row { margin-top: 25px; display: flex; justify-content: space-between; color: #c4ccdb; font-size: 11px; }
.progress-row strong { color: var(--white); font-variant-numeric: tabular-nums; }
.progress-track { height: 11px; margin-top: 9px; overflow: hidden; border: 1px solid #8792a8; border-radius: 999px; background: #303b53; }
.progress-track i { display: block; width: 0; height: 100%; background: var(--yellow); }
.episode-nav { display: grid; gap: 10px; }
.episode-nav-item { width: 100%; min-height: 82px; padding: 12px; display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 10px; border: 1px solid #38435b; border-radius: 14px; background: #1c263d; color: var(--white); text-align: right; }
.episode-nav-item:hover, .episode-nav-item.active { border-color: var(--yellow); background: #29344d; }
.nav-number { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: #303b53; font: 800 18px "Baloo Bhaijaan 2",sans-serif; font-variant-numeric: tabular-nums; }
.episode-nav-item.active .nav-number { background: var(--yellow); color: var(--ink); }
.episode-nav-item > span:nth-child(2) { min-width: 0; display: grid; }
.episode-nav-item small { color: #aeb9ce; font-size: 9px; }
.episode-nav-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.episode-nav-item i { padding: 4px 7px; border-radius: 999px; background: #303b53; color: #c4ccdb; font-size: 9px; font-style: normal; }
.episode-nav-item i.done { background: var(--green); color: var(--white); }
.sidebar-logout { min-height: 44px; margin-top: auto; border: 0; background: transparent; color: #c4ccdb; text-decoration: underline; }
.lesson-workspace { min-width: 0; }
.workspace-header { min-height: 112px; padding: 22px clamp(22px,4vw,56px); display: flex; justify-content: space-between; align-items: center; gap: 24px; border-bottom: 2px solid var(--ink); background: var(--white); }
.workspace-title { flex: 1; }
.workspace-header span { color: var(--blue); font-size: 10px; font-weight: 800; }
.workspace-header h1 { margin-top: 5px; font-size: clamp(27px,3vw,42px); }
.save-state { color: var(--muted); font-size: 10px; white-space: nowrap; }
.save-state span { color: var(--green); }
.mobile-course-menu { display: none; }
.lesson-content { width: min(100%,1050px); margin: auto; padding: 42px clamp(18px,4vw,52px) 80px; }
.video-card, .mission-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.video-card video { width: 100%; aspect-ratio: 16/9; background: #050814; }
.video-caption { min-height: 64px; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-top: 2px solid var(--ink); }
.video-caption span { padding: 5px 9px; border-radius: 999px; background: var(--soft-blue); font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.video-caption p { margin: 0; color: var(--muted); font-size: 11px; }
.mission-card { margin-top: 34px; padding: clamp(22px,4vw,40px); }
.mission-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; padding-bottom: 25px; border-bottom: 2px solid var(--line); }
.mission-number { padding: 7px 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--cyan); font-size: 10px; font-weight: 800; }
.mission-head h2 { font-size: clamp(28px,3vw,40px); }
.mission-head p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.mission-status { padding: 8px 11px; border-radius: 999px; background: #edf0f5; color: var(--muted); font-size: 10px; white-space: nowrap; }
.mission-status.done { background: #dff4e8; color: var(--green); font-weight: 800; }
#exerciseMount { padding-top: 30px; }
.exercise-message { min-height: 30px; margin: 20px 0 0; font-weight: 800; }
.exercise-message.success { color: var(--green); }
.exercise-message.error { color: #b3202d; }
.lesson-complete-card { margin-top: 28px; padding: 22px; display: flex; align-items: center; gap: 16px; border: 2px solid var(--green); border-radius: var(--radius); background: #e6f7ed; box-shadow: 5px 5px 0 var(--green); }
.complete-badge { width: 56px; height: 56px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--green); color: var(--white); font-size: 28px; font-weight: 900; }
.lesson-complete-card div { flex: 1; }
.lesson-complete-card strong { font: 800 24px "Baloo Bhaijaan 2",sans-serif; }
.lesson-complete-card p { margin: 2px 0 0; color: #346a4c; font-size: 11px; }
.sidebar-scrim { display: none; }

.sandwich-game { display: grid; grid-template-columns: minmax(260px,1fr) minmax(240px,.72fr); gap: 28px; align-items: center; }
.step-list { margin: 0; padding: 0; display: grid; gap: 9px; list-style: none; counter-reset: steps; }
.step-item { min-height: 58px; padding: 7px 10px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 9px; border: 2px solid var(--ink); border-radius: 12px; background: var(--white); counter-increment: steps; }
.step-item::before { content: counter(steps); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.step-item > span:first-of-type { font-size: 11px; }
.step-actions { display: flex; direction: ltr; }
.step-actions button { width: 44px; height: 44px; border: 0; border-radius: 9px; background: var(--soft-blue); font-weight: 900; }
.step-actions button:disabled { opacity: .35; }
.sandwich-stage { min-height: 280px; padding: 24px; display: grid; place-items: center; border: 3px dashed var(--ink); border-radius: 20px; background: #fff1d6; }
.sandwich-visual { width: 190px; min-height: 180px; display: flex; flex-direction: column-reverse; justify-content: end; gap: 3px; }
.sandwich-layer { height: 34px; border: 2px solid var(--ink); border-radius: 50%; transform: scaleX(.2); opacity: 0; transition: transform 180ms ease-out, opacity 180ms ease-out; }
.sandwich-layer.show { transform: scaleX(1); opacity: 1; }
.bread { background: #eeb967; }
.cheese { background: #ffd62e; clip-path: polygon(3% 10%,97% 0,88% 100%,0 88%); }
.plate { height: 22px; background: #d9f3ff; }
.game-controls { margin-top: 17px; display: flex; flex-wrap: wrap; gap: 9px; }
.robot-game { display: grid; grid-template-columns: minmax(300px,.85fr) minmax(280px,1.15fr); gap: 30px; align-items: center; direction: ltr; }
.game-grid { width: min(100%,400px); aspect-ratio: 1; display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; direction: ltr; }
.grid-cell { position: relative; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 12px; background: var(--white); font: 800 clamp(25px,4vw,42px) sans-serif; }
.grid-cell:nth-child(even) { background: var(--soft-blue); }
.grid-cell.rock { color: #6e7789; background: #cfd4dd; }
.grid-cell.goal { color: #d79d00; background: #fff3a7; }
.grid-cell.robot::after { content: "◉"; width: 58%; aspect-ratio: 1; display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 13px; background: var(--cyan); color: var(--ink); font-size: 27px; box-shadow: 3px 3px 0 var(--ink); }
.command-panel { direction: rtl; }
.command-buttons { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.command-buttons button { min-height: 58px; border: 2px solid var(--ink); border-radius: 12px; background: var(--white); font: 800 26px sans-serif; box-shadow: 3px 3px 0 var(--ink); }
.command-buttons button:hover { background: var(--yellow); }
.program-queue { min-height: 74px; margin: 18px 0; padding: 12px; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; border: 2px dashed var(--ink); border-radius: 14px; background: #f4f7fc; direction: ltr; }
.program-queue:empty::after { content: "اختار الأسهم عشان تبني البرنامج"; width: 100%; color: var(--muted); font-size: 11px; text-align: center; direction: rtl; }
.program-chip { width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 9px; background: var(--yellow); font: 800 24px sans-serif; }
.program-chip.active { background: var(--coral); color: var(--white); }
.command-panel .game-controls { direction: rtl; }
.repeat-grid { aspect-ratio: 5 / 3; grid-template-columns: repeat(5,1fr); }
.repeat-builder { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.repeat-builder label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 800; }
.repeat-builder select, .rule-card select { min-height: 48px; padding: 8px 12px; border: 2px solid #b7d7d3; border-radius: 14px; background: var(--white); color: var(--ink); font: inherit; }
.repeat-builder .button { grid-column: 1 / -1; }
.repeat-queue { direction: rtl; }
.repeat-queue::after { display: none; }
.repeat-chip { min-width: 112px; min-height: 58px; padding: 7px 12px; display: grid; grid-template-columns: 42px 1fr; align-items: center; border-radius: 15px; background: var(--yellow); color: var(--ink); }
.repeat-chip b { grid-row: 1 / span 2; font-size: 27px; }
.repeat-chip small { font-size: 10px; font-weight: 800; }
.repeat-chip.active { background: var(--cyan); }
.queue-placeholder { width: 100%; color: var(--muted); font-size: 11px; text-align: center; }
.condition-game { display: grid; gap: 22px; }
.condition-road { min-height: 120px; padding: 20px; display: flex; align-items: center; justify-content: space-around; gap: 12px; border-radius: 24px; background: var(--soft-blue); direction: ltr; }
.condition-robot, .road-event { width: 62px; height: 62px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 18px; background: var(--white); color: var(--ink); font: 800 28px sans-serif; }
.condition-robot { background: var(--cyan); }
.road-event.active { transform: translateY(-5px); background: var(--yellow); }
.road-event.correct { background: #bcebd0; color: var(--green); }
.road-event.wrong { background: #ffd4d1; color: #a5222d; }
.rule-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.rule-card { min-width: 0; padding: 16px; display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 8px; border: 2px solid var(--line); border-radius: 20px; background: var(--white); }
.rule-card > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--yellow); font: 800 21px sans-serif; }
.rule-card strong { font-size: 11px; }
.rule-card select { grid-column: 1 / -1; width: 100%; }
.rule-card.active { border-color: var(--yellow); }
.rule-card.correct { border-color: var(--green); background: #effaf4; }
.rule-card.wrong { border-color: var(--coral); background: #fff1f0; }

.variable-game { display: grid; grid-template-columns: minmax(220px,.7fr) minmax(320px,1.3fr); gap: 28px; align-items: center; }
.variable-stage { min-height: 260px; padding: 28px; display: grid; place-items: center; align-content: center; gap: 10px; border: 3px solid var(--ink); border-radius: 24px; background: var(--soft-blue); box-shadow: 6px 6px 0 var(--ink); }
.variable-name { padding: 6px 14px; border-radius: 999px; background: var(--blue); color: var(--white); font-size: 11px; font-weight: 800; }
.variable-stage strong { font: 800 82px "Baloo Bhaijaan 2",sans-serif; font-variant-numeric: tabular-nums; line-height: 1; }
.variable-stage small { color: var(--muted); font-weight: 800; }
.variable-builder > p { color: var(--muted); font-size: 11px; font-weight: 800; text-wrap: pretty; }
.change-buttons { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.change-buttons button { min-height: 56px; border: 2px solid var(--ink); border-radius: 12px; background: var(--yellow); color: var(--ink); font: 800 22px "Baloo Bhaijaan 2",sans-serif; box-shadow: 3px 3px 0 var(--ink); }
.variable-queue { direction: rtl; }
.variable-queue::after { display: none; }
.variable-chip { min-height: 44px; padding: 9px 12px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 10px; background: var(--white); font-size: 10px; font-weight: 800; }
.variable-chip.active { background: var(--cyan); }

.event-game { display: grid; gap: 22px; }
.event-console { min-height: 105px; padding: 20px 24px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 16px; border: 2px solid var(--ink); border-radius: 20px; background: var(--ink); color: var(--white); }
.event-console > span { grid-row: 1 / span 2; padding: 6px 10px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: 10px; font-weight: 800; }
.event-console strong { font-size: 18px; text-wrap: balance; }
.event-console i { color: #bfc9dc; font-size: 11px; font-style: normal; }
.event-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.event-card { min-width: 0; padding: 16px; display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 9px; border: 2px solid var(--line); border-radius: 20px; background: var(--white); }
.event-card > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--cyan); font: 800 19px sans-serif; }
.event-card strong { font-size: 11px; text-wrap: balance; }
.event-card select, .bug-card select { grid-column: 1 / -1; width: 100%; min-height: 48px; padding: 8px 12px; border: 2px solid #b7d7d3; border-radius: 14px; background: var(--white); color: var(--ink); font: inherit; }
.event-card.active, .bug-card.active { border-color: var(--yellow); }
.event-card.correct, .bug-card.correct { border-color: var(--green); background: #effaf4; }
.event-card.wrong, .bug-card.wrong { border-color: var(--coral); background: #fff1f0; }

.function-game { display: grid; grid-template-columns: minmax(300px,1fr) minmax(260px,.8fr); gap: 28px; align-items: stretch; }
.function-card { overflow: hidden; border: 2px solid var(--ink); border-radius: 20px; background: var(--white); box-shadow: 5px 5px 0 var(--ink); }
.function-title { padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 14px; background: var(--blue); color: var(--white); }
.function-title span { padding: 5px 9px; border-radius: 999px; background: var(--yellow); color: var(--ink); font-size: 10px; font-weight: 800; }
.function-title strong { font-family: monospace; direction: ltr; }
.function-steps { margin: 0; padding: 18px; display: grid; gap: 9px; list-style: none; counter-reset: function-step; }
.function-steps li { min-height: 58px; padding: 7px 10px; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 9px; border: 2px solid var(--line); border-radius: 12px; counter-increment: function-step; }
.function-steps li::before { content: counter(function-step); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--cyan); font-weight: 800; font-variant-numeric: tabular-nums; }
.function-stage { min-height: 300px; padding: 24px; display: grid; place-items: center; align-content: center; gap: 18px; border-radius: 20px; background: #fff1d6; }
.dance-robot { width: 92px; height: 92px; display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 24px; background: var(--cyan); font: 800 38px sans-serif; box-shadow: 5px 5px 0 var(--ink); transition: transform 180ms ease-out; }
.dance-robot[data-move="jump"] { transform: translateY(-22px); }
.dance-robot[data-move="turn"] { transform: rotate(16deg); }
.dance-robot[data-move="clap"] { transform: scale(1.12); }
.call-stack { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; direction: ltr; }
.call-stack span { padding: 7px 10px; border: 2px solid var(--ink); border-radius: 9px; background: var(--yellow); font: 700 10px monospace; }

.final-game { display: grid; gap: 22px; }
.project-preview { position: relative; min-height: 150px; padding: 24px; display: flex; align-items: center; justify-content: space-around; gap: 18px; overflow: hidden; border: 2px solid var(--ink); border-radius: 24px; background: var(--soft-blue); direction: ltr; }
.project-preview::after { content: ""; position: absolute; inset: auto 6% 34px; border-top: 5px dashed #9fb6c7; }
.project-robot, .project-rock, .project-star { position: relative; z-index: 1; width: 66px; height: 66px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 18px; background: var(--white); font: 800 28px sans-serif; }
.project-robot { background: var(--cyan); transition: transform 180ms ease-out; }
.project-robot.at-rock { transform: translateX(95px); }
.project-robot.past-rock { transform: translate(145px,-22px); }
.project-robot.at-star { transform: translateX(260px); }
.project-star { background: var(--yellow); color: #9a6a00; }
.project-preview strong { position: absolute; z-index: 2; inset: 10px auto auto 12px; padding: 5px 9px; border-radius: 999px; background: var(--ink); color: var(--white); font-size: 10px; font-variant-numeric: tabular-nums; }
.bug-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.bug-card { min-width: 0; padding: 14px; display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 8px; border: 2px solid var(--line); border-radius: 18px; background: var(--white); }
.bug-card > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--coral); color: var(--white); font-weight: 800; font-variant-numeric: tabular-nums; }
.bug-card strong { font-size: 11px; text-wrap: balance; }

.part-two-course { border-color: var(--cyan); }
.part-two-course .market-meta b { background: var(--cyan); color: #102f3e; }
.part2-game { padding: clamp(18px,3vw,30px); border: 2px solid var(--ink); border-radius: var(--radius); background: #eef9f7; }
.part2-controls { display: flex; flex-wrap: wrap; align-items: end; justify-content: center; gap: 14px; }
.part2-controls label { min-width: 150px; display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 800; }
.part2-game select { min-height: 48px; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 13px; background: var(--white); color: var(--ink); }
.part2-game select:focus-visible, .part2-game button:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; }
.coordinate-game, .loop-builder, .clone-game { display: grid; grid-template-columns: minmax(260px,.9fr) minmax(280px,1.1fr); align-items: center; gap: 26px; }
.coordinate-board { max-width: 390px; width: 100%; aspect-ratio: 1; padding: 12px; justify-self: center; display: grid; grid-template-columns: repeat(5,1fr); direction: ltr; border: 3px solid var(--ink); border-radius: 24px; background: var(--white); }
.coordinate-cell { display: grid; place-items: center; border: 1px solid #b8d8d3; font: 800 25px sans-serif; }
.coordinate-cell.treasure { color: #9a6a00; }
.coordinate-cell.selected { background: var(--yellow); box-shadow: inset 0 0 0 3px var(--ink); }
.pattern-grid { --pattern-cols: 1; min-height: 280px; padding: 25px; display: grid; grid-template-columns: repeat(var(--pattern-cols),48px); grid-auto-rows: 48px; place-content: center; gap: 10px; border: 3px solid var(--ink); border-radius: 24px; background: var(--white); direction: ltr; }
.pattern-grid span { display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 13px; background: var(--cyan); color: var(--ink); font-size: 24px; }
.random-game { display: grid; justify-items: center; gap: 22px; }
.digital-die { width: 126px; height: 126px; display: grid; place-items: center; border: 4px solid var(--ink); border-radius: 30px; background: var(--white); box-shadow: 7px 7px 0 var(--ink); font: 800 58px "Baloo Bhaijaan 2",sans-serif; font-variant-numeric: tabular-nums; }
.random-history { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; direction: ltr; }
.random-history span { width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--yellow); font-weight: 800; font-variant-numeric: tabular-nums; }
.list-game { display: grid; justify-items: center; gap: 20px; }
.inventory-list { width: min(100%,680px); min-height: 100px; padding: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; border: 3px solid var(--ink); border-radius: 24px; background: var(--white); }
.inventory-list span { min-height: 44px; padding: 7px 12px; display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--ink); border-radius: 14px; background: var(--yellow); font-weight: 800; }
.inventory-list b { font-variant-numeric: tabular-nums; }
.item-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.item-buttons button { min-height: 44px; padding: 8px 15px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); color: var(--ink); font-weight: 800; }
.item-buttons button.selected { background: var(--cyan); }
.game-note { margin: 0; color: var(--muted); font-size: 11px; }
.clone-stage { min-height: 260px; padding: 25px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 3px solid var(--ink); border-radius: 24px; background: var(--white); }
.clone-stage span { width: 52px; height: 52px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 15px; background: var(--yellow); font-size: 28px; }
.clone-stage.stack span { margin-inline-start: -40px; }
.clone-stage.stack span:first-child { margin-inline-start: 0; }
.clone-stage.random { align-content: center; flex-wrap: wrap; }
.message-game, .debug-game, .maze-project { display: grid; gap: 20px; }
.message-wires, .debug-cases, .maze-systems { display: grid; gap: 12px; }
.message-wires label, .debug-cases label, .maze-systems label { min-height: 74px; padding: 12px 15px; display: grid; grid-template-columns: minmax(150px,1fr) minmax(190px,1fr); align-items: center; gap: 14px; border: 2px solid var(--line); border-radius: 18px; background: var(--white); }
.debug-cases label { grid-template-columns: 44px minmax(150px,1fr) minmax(190px,1fr); }
.debug-cases b { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--coral); color: var(--white); font-variant-numeric: tabular-nums; }
.maze-preview { position: relative; min-height: 220px; overflow: hidden; border: 3px solid var(--ink); border-radius: 24px; background: var(--white); }
.maze-preview::before { content: ""; position: absolute; inset: 28px 25%; border-inline: 16px solid var(--blue); }
.maze-preview span { position: absolute; z-index: 1; width: 52px; height: 52px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 14px; font: 800 27px sans-serif; }
.maze-player { inset: auto auto 22px 22px; background: var(--cyan); }
.maze-key { inset: 24px 48% auto auto; background: var(--orange); }
.maze-treasure { inset: 22px 22px auto auto; background: var(--yellow); }
.maze-preview.complete .maze-player { inset: 22px 22px auto auto; background: var(--yellow); }

.toast { position: fixed; z-index: var(--z-toast); inset: auto max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) auto; max-width: min(420px,calc(100vw - 32px)); padding: 14px 18px; border: 2px solid var(--ink); border-radius: 13px; background: var(--yellow); box-shadow: 5px 5px 0 var(--ink); font-weight: 800; opacity: 0; transform: translateY(18px); pointer-events: none; transition: opacity 180ms ease-out, transform 180ms ease-out; }
.toast.show { opacity: 1; transform: translateY(0); }
.account-card { display: flex; align-items: center; gap: 9px; }
.avatar-fallback { width: 42px; height: 42px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--yellow); font-weight: 800; }
.account-card strong { display: block; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.account-card button { min-width: 44px; min-height: 44px; border: 0; background: transparent; text-decoration: underline; }
.account-links { display: flex; align-items: center; }
.account-links button { padding: 4px 7px; font-size: 10px; }

@media (max-width: 1000px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-header nav { display: none; }
  .hero { grid-template-columns: 1fr; padding-bottom: 100px; }
  .hero-stage { width: min(100%,620px); justify-self: center; }
  .shamsita-brand { width: 200px; }
  .brand-logo-frame { width: 200px; height: 66px; }
  .brand-logo-frame img { top: -88px; left: -15px; width: 230px; }
  .promise-strip { align-items: stretch; }
  .promise-strip > div { flex: 1; }
  .promise-strip i { display: none; }
  .category-strip { align-items: flex-start; flex-direction: column; }
  .category-strip > div { justify-content: flex-start; }
  .course-market-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .learning-paths { grid-template-columns: 1fr; }
  .enrolled-course-card { grid-template-columns: 1fr; }
  .enrolled-course-cover { min-height: 300px; border-bottom: 3px solid var(--ink); border-left: 0; }
  .courses-empty { grid-template-columns: 90px 1fr; }
  .courses-empty .button { grid-column: 1 / -1; }
  .section-heading { grid-template-columns: 1fr; gap: 22px; }
  .classroom { grid-template-columns: 1fr; }
  .course-sidebar { position: fixed; inset: 0 0 0 auto; width: min(88vw,330px); transform: translateX(110%); transition: transform 180ms ease-out; }
  .classroom.sidebar-open .course-sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: calc(var(--z-sidebar) - 1); inset: 0; width: 100%; height: 100%; border: 0; background: rgba(16,24,44,.68); opacity: 0; pointer-events: none; transition: opacity 180ms ease-out; }
  .classroom.sidebar-open .sidebar-scrim { display: block; opacity: 1; pointer-events: auto; }
  .mobile-course-menu { display: inline-flex; }
  .sandwich-game, .robot-game, .variable-game, .function-game { grid-template-columns: 1fr; }
  .coordinate-game, .loop-builder, .clone-game { grid-template-columns: 1fr; }
  .game-grid { justify-self: center; }
}

@media (max-width: 680px) {
  .classroom, .lesson-workspace, .lesson-content, .video-card, .mission-card { width: 100%; max-width: 100%; min-width: 0; }
  .site-header { min-height: 68px; padding: 10px 14px; }
  .brand { font-size: 17px; }
  .brand-mark { min-width: 43px; height: 40px; }
  .shamsita-brand { width: 180px; }
  .brand-logo-frame { width: 180px; height: 59px; }
  .brand-logo-frame img { top: -79px; left: -13px; width: 206px; }
  .button-auth { padding-inline: 11px; font-size: 0; }
  .button-auth .login-symbol { font-size: 16px; }
  .hero { min-height: auto; padding-top: 48px; }
  .hero h1 { font-size: 48px; }
  .hero-facts { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
  .hero-facts strong { font-size: 16px; }
  .course-search { grid-template-columns: 1fr; }
  .course-search button { width: 100%; }
  .hero-stage { min-height: 420px; padding: 70px 24px 45px; border-radius: 28px 28px 60px 28px; box-shadow: 8px 8px 0 var(--ink); }
  .shamsita-stage { min-height: 470px; padding: 0; border-radius: 48% 48% 20% 20% / 24% 24% 15% 15%; box-shadow: 0 12px 0 var(--purple), var(--shadow); }
  .sun-shape { inset: 18px 24px auto auto; font-size: 78px; }
  .kids-friends { inset: auto 3% 120px; }
  .kid-face { width: 102px; flex-basis: 102px; }
  .kid-face i { box-shadow: 35px 0 0 #142a3a; }
  .play-card { inset: auto 6% 24px; padding: 14px 12px; }
  .doodle-one { inset: 130px auto auto 14px; }
  .marketplace-stage { min-height: 510px; padding: 72px 18px 20px; }
  .stage-feature { padding: 18px; gap: 14px; }
  .stage-icon { width: 72px; height: 72px; }
  .stage-feature strong { font-size: 23px; }
  .stage-mini { padding: 12px; }
  .stage-mini span { width: 42px; height: 42px; }
  .promise-strip { padding-block: 20px; display: grid; }
  .promise-strip > div { width: 100%; }
  .catalog { padding-block: 72px; }
  .preview-grid { grid-template-columns: 1fr; }
  .course-market-grid { grid-template-columns: 1fr; }
  .preview-card { box-shadow: 5px 5px 0 var(--ink); }
  .preview-card > div { padding: 22px; }
  .enroll-banner { align-items: stretch; flex-direction: column; border-radius: 24px; }
  .learning-paths { padding-block: 72px; }
  .my-courses-view { padding-top: 52px; }
  .learning-dashboard-head { grid-template-columns: 1fr; align-items: start; }
  .learning-dashboard-head .button { width: 100%; }
  .dashboard-stats { margin-block: 35px 55px; grid-template-columns: 1fr; }
  .dashboard-stats > div { min-height: 100px; }
  .dashboard-section-title { align-items: flex-start; flex-direction: column; gap: 4px; }
  .enrolled-course-cover { min-height: 210px; }
  .course-resume-row { align-items: stretch; flex-direction: column; }
  .course-resume-row .button { width: 100%; }
  .courses-empty { grid-template-columns: 1fr; text-align: center; }
  .empty-icon { margin: auto; }
  footer { align-items: flex-start; flex-direction: column; }
  .auth-dialog, .enroll-dialog { padding: 46px 20px 25px; }
  .auth-dialog h2, .enroll-dialog h2 { font-size: 34px; }
  .workspace-header { width: 100%; min-width: 0; min-height: 92px; padding: 14px; overflow: hidden; display: grid; grid-template-columns: auto minmax(0,1fr); }
  .workspace-title { min-width: 0; grid-column: 1 / -1; }
  .workspace-header h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 24px; }
  .save-state { grid-column: 1 / -1; justify-self: end; }
  .lesson-content { padding-top: 22px; }
  .video-caption { align-items: flex-start; flex-direction: column; gap: 8px; }
  .video-card video { width: 100%; min-width: 0; }
  .mission-head { grid-template-columns: 1fr; gap: 10px; }
  .mission-status { justify-self: start; }
  .lesson-complete-card { align-items: flex-start; flex-wrap: wrap; }
  .lesson-complete-card .button { width: 100%; }
  .sandwich-stage { min-height: 230px; }
  .command-buttons { grid-template-columns: repeat(2,1fr); }
  .repeat-builder, .rule-list, .event-list, .bug-list { grid-template-columns: 1fr; }
  .repeat-builder .button { grid-column: auto; }
  .condition-road { padding: 12px; }
  .condition-robot, .road-event { width: 52px; height: 52px; }
  .change-buttons { grid-template-columns: 1fr; }
  .project-robot.at-rock { transform: translateX(52px); }
  .project-robot.past-rock { transform: translate(82px,-18px); }
  .project-robot.at-star { transform: translateX(150px); }
  .message-wires label, .debug-cases label, .maze-systems label { grid-template-columns: 1fr; }
  .debug-cases label { justify-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
