:root {
  color-scheme: light;
  font-family: Nunito, system-ui, sans-serif;
  font-size: 16px;
  color: #272139;
  background: #f8f7fb;
  --ink: #272139;
  --muted: #625a72;
  --primary: #6943c7;
  --primary-deep: #5532ab;
  --line: #e9e4f1;
  --surface: #fff;
  --content: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 290px; }
button, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:enabled, select { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #663dd1; outline-offset: 4px; }
button:disabled { cursor: default; }
.shell { width: min(var(--content), calc(100% - 64px)); margin-inline: auto; }
.visually-hidden, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip:focus { position: fixed; z-index: 10; top: 12px; left: 12px; padding: 10px; background: white; border-radius: 8px; }

.site-header { background: #fffeff; border-bottom: 1px solid #eee9f4; }
.header-layout { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 11px; width: max-content; font-size: 1.43rem; font-weight: 1000; line-height: 1.08; letter-spacing: -.035em; }
.brand small { display: block; color: var(--muted); font-size: .75rem; font-weight: 750; letter-spacing: .005em; margin-top: 4px; }
.mark { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; padding-bottom: 3px; font: 800 1.75rem/1 'Noto Sans Arabic', sans-serif; color: white; border-radius: 13px; background: #754bd8; box-shadow: inset 0 -3px 0 #613abf; }
.nav { display: flex; justify-content: center; align-items: center; gap: 7px; }
.nav a { display: inline-flex; gap: 9px; align-items: center; padding: 10px 14px; min-height: 44px; color: #564d65; border-radius: 12px; font-weight: 850; }
.nav a:hover, .nav a[aria-current] { color: var(--primary-deep); background: #f0e9ff; }
.header-tools { justify-self: end; display: flex; align-items: center; gap: 7px; }
.effects-toggle { position: relative; display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid #e4dced; border-radius: 12px; background: #f6f1ff; color: #5b3b91; }
.effects-toggle:hover { background: #efe6ff; }
.effects-toggle[aria-pressed="false"] { background: white; color: var(--muted); }
.effects-toggle[aria-pressed="false"]::after { position: absolute; content: ""; width: 22px; height: 2px; border-radius: 2px; background: currentColor; box-shadow: 0 0 0 1px white; transform: rotate(-45deg); }
.star-total { justify-self: end; display: inline-flex; gap: 8px; align-items: center; min-width: 64px; min-height: 42px; padding: 5px 12px; border: 1px solid #f0dfae; background: #fff5d9; color: #6a4806; border-radius: 13px; font-weight: 950; }
.star-total span, .gold { color: #aa6709; font-family: system-ui, sans-serif; }
.star-total span { color: #e99112; font-size: 1.22rem; }

.ui { display: inline-block; position: relative; color: currentColor; width: 1.12em; height: 1.12em; flex: none; }
.ui.book::before, .ui.book::after { content: ""; position: absolute; top: 14%; height: 72%; width: 52%; border: .11em solid; background: transparent; }
.ui.book::before { left: 0; border-radius: 3px 0 0 3px; transform: skewY(9deg); }
.ui.book::after { right: 0; border-radius: 0 3px 3px 0; transform: skewY(-9deg); }
.ui.play::before { content: ""; position: absolute; left: 22%; top: 10%; width: 74%; height: 80%; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); border-radius: 2px; }
.ui.chart::before { content: ""; position: absolute; inset: 12%; background: linear-gradient(to top, currentColor 0 47%, transparent 48%) left/21% 100% no-repeat, linear-gradient(to top, currentColor 0 75%, transparent 76%) center/21% 100% no-repeat, linear-gradient(currentColor, currentColor) right/21% 100% no-repeat; }
.ui.sound::before { content: ""; position: absolute; inset: 16% 44% 16% 0; background: currentColor; clip-path: polygon(0 28%, 34% 28%, 100% 0, 100% 100%, 34% 72%, 0 72%); }
.ui.sound::after { content: ""; position: absolute; height: 82%; width: 78%; top: 9%; right: 0; border: .12em solid transparent; border-right-color: currentColor; border-radius: 50%; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 10px 19px; border-radius: 13px; border: 1px solid transparent;
  font-weight: 900; line-height: 1.2; text-align: center; transition: background .15s, box-shadow .15s, transform .15s;
}
.button:active:not(:disabled) { transform: translateY(2px); }
.button.primary { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 3px 0 #4e2ca6; }
.button.primary:hover { background: var(--primary-deep); }
.button.secondary { background: #fff; color: #493378; border-color: #ded3f0; box-shadow: 0 2px 0 #e9e1f1; }
.button.secondary:hover:not(:disabled) { background: #f6efff; }
.button.known { color: #1f6a48; background: #e6faed; border-color: #a8dfbc; }
.button:disabled { opacity: .5; }
.arabic { font-family: 'Noto Sans Arabic', Tahoma, sans-serif; font-weight: 700; line-height: 1.6; unicode-bidi: isolate; }
.art { object-fit: contain; width: 100%; height: 100%; user-select: none; }
.photo { object-fit: contain; min-width: 0; max-width: 100%; user-select: none; }

.hero {
  position: relative; display: grid; grid-template-columns: 1fr 1.05fr; align-items: stretch;
  min-height: 336px; margin-top: 26px; overflow: hidden; isolation: isolate;
  border: 1px solid #e9dfff; border-radius: 32px; background: #ede4ff;
  background-image: radial-gradient(ellipse at 72% 45%, #f8f0ff 0, #f1e9ff 34%, transparent 68%);
}
.hero-copy { position: relative; z-index: 2; align-self: center; padding: 34px 0 38px 48px; }
.hero h1 { font-size: clamp(2.65rem, 5.3vw, 4.25rem); font-weight: 1000; letter-spacing: -.059em; line-height: 1; }
.hero h1 em { color: var(--primary); font-style: normal; }
.hero-copy p { margin-top: 12px; max-width: 390px; font-size: 1.12rem; color: #524666; line-height: 1.4; font-weight: 750; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-actions .button { min-height: 54px; padding-inline: 23px; }
.hero-scene { position: relative; min-width: 0; align-self: stretch; }
.scene-halo { position: absolute; width: 66%; aspect-ratio: 1; left: 15%; top: 8%; border: 1px solid #fdf8ff; border-radius: 50%; background: #f4edff; box-shadow: 0 0 0 29px #f4edff80, 0 0 0 57px #e8d8f948; }
.fox { position: absolute; z-index: 1; width: 104%; max-width: none; height: 92%; object-fit: contain; right: 3%; bottom: -1%; filter: drop-shadow(0 13px 10px #7347a928); }
.sparkle { position: absolute; z-index: 2; line-height: 1; }
.sparkle-top { top: 13%; left: 13%; color: #b088f5; font-size: 2rem; transform: rotate(-9deg); }
.sparkle-side { right: 8%; top: 52%; color: #8e64d2; font-size: 1.45rem; }
.hello-bubble { position: absolute; z-index: 3; right: 6%; top: 15%; display: flex; align-items: center; gap: 11px; padding: 10px 15px; min-width: 120px; background: #fffdfd; border: 1px solid #e5d8f7; border-radius: 19px 19px 19px 6px; box-shadow: 0 7px 15px #4d26751a; transform: rotate(8deg); }
.hello-bubble:hover { transform: rotate(4deg) translateY(-2px); }
.hello-bubble .ui { font-size: 1.1rem; color: var(--primary); }
.hello-bubble .arabic { display: block; color: #523495; font-size: 1.43rem; line-height: 1.2; }
.hello-bubble small { display: block; color: #665c71; font-size: .8rem; text-align: start; font-weight: 850; }

.section { margin-top: 37px; scroll-margin-top: 24px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.section-heading h1 { font-size: clamp(2rem, 4.8vw, 3.15rem); font-weight: 1000; letter-spacing: -.05em; line-height: 1.06; }
.section-heading h2, .side-title h2, .review-panel h2 { font-size: clamp(1.65rem, 3.15vw, 2.05rem); font-weight: 1000; letter-spacing: -.044em; line-height: 1.14; }
.section-heading p { color: var(--muted); font-size: 1.03rem; font-weight: 700; margin-top: 5px; }
.topics-grid, .games-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tone-fruit { --tone: #fde7ec; --edge: #f4cdd8; --accent: #942353; --light: #fff5f7; }
.tone-vegetables { --tone: #e4f6e9; --edge: #ccebd5; --accent: #1f6946; --light: #f4fdf6; }
.tone-colors { --tone: #eee4ff; --edge: #e4d3fc; --accent: #653ca9; --light: #f8f3ff; }
.tone-animals { --tone: #fff0cf; --edge: #f2e2b9; --accent: #825013; --light: #fffbef; }
.tone-home { --tone: #e3f3ff; --edge: #cbe7f9; --accent: #245f95; --light: #f4faff; }
.tone-food { --tone: #ffe9de; --edge: #f5d7c8; --accent: #91462c; --light: #fff7f2; }
.tone-numbers { --tone: #fff2ca; --edge: #f1e0a5; --accent: #79520a; --light: #fffbec; }
.tone-phrases { --tone: #e4eefb; --edge: #cedcf3; --accent: #3c5692; --light: #f4f8ff; }
.tone-clothes { --tone: #fbe7f6; --edge: #efd0e7; --accent: #894070; --light: #fff5fc; }
.tone-body { --tone: #dff6f1; --edge: #c4eade; --accent: #236e60; --light: #f1fbf8; }
.tone-transport { --tone: #e5ecff; --edge: #cddaff; --accent: #394e8f; --light: #f5f8ff; }
.tone-actions { --tone: #f2e5ff; --edge: #e7d4f7; --accent: #6e418b; --light: #fbf6ff; }
.topic-card { position: relative; display: grid; align-content: space-between; min-height: 150px; overflow: hidden; padding: 13px 16px 14px; border-radius: 21px; border: 1px solid var(--edge); background: var(--tone); color: var(--ink); transition: transform .18s, box-shadow .18s; }
.topic-card::after { content: ""; position: absolute; width: 126px; height: 126px; right: -46px; bottom: -62px; border: 1px solid #ffffff85; border-radius: 50%; box-shadow: 0 0 0 17px #ffffff35, 0 0 0 37px #ffffff24; pointer-events: none; }
.topic-card:hover, .game-card:hover { transform: translateY(-3px); box-shadow: 0 7px 16px #4f317614; }
.tile-top, .tile-bottom { position: relative; z-index: 1; }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tile-art { display: block; flex: 0 0 auto; width: 68px; height: 64px; }
.tile-art .art { filter: drop-shadow(0 3px 3px #3826211a); }
.tile-arabic { color: var(--accent); font-size: 1.1rem; text-align: right; line-height: 1.25; padding-top: 4px; }
.tile-bottom :is(h2, h3) { font-weight: 1000; line-height: 1.15; font-size: 1.25rem; letter-spacing: -.025em; }
.tile-bottom > span { color: var(--accent); font-size: .9rem; font-weight: 800; }
.games-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch; }
.game-card { display: flex; flex-direction: column; gap: 11px; min-height: 155px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 20px; background: white; transition: transform .18s, box-shadow .18s; }
.game-art { width: 54px; height: 54px; flex: none; display: grid; place-items: center; background: var(--tone); border-radius: 15px; padding: 9px; }
.game-card h2 { font-size: 1.13rem; letter-spacing: -.02em; font-weight: 1000; }
.game-card p { font-size: .94rem; line-height: 1.35; font-weight: 700; color: var(--muted); margin-top: 3px; }
.memory-art { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; width: 100%; }
.memory-art .art { padding: 2px; background: #fff; border: 1px solid #a9d3ee; border-radius: 4px; }
.memory-art .art:first-child { transform: rotate(-12deg); }
.memory-art .art:last-child { transform: rotate(10deg); }
.home-game { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin-top: 20px; padding: 12px 16px; border: 1px solid #cbe7f9; border-radius: 18px; background: #f1f9ff; }
.home-game:hover { background: #e3f3ff; }
.home-game strong { display: block; font-size: 1.1rem; font-weight: 1000; }
.home-game small { display: block; color: var(--muted); font-size: .94rem; font-weight: 750; }
.home-game > .ui { color: #245f95; }
.select-label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .88rem; font-weight: 850; }
.select-label select { appearance: none; min-height: 43px; color: var(--ink); border: 1px solid #e3dcee; border-radius: 11px; font-weight: 850; padding: 7px 34px 7px 12px; background: white; }
.select-label { position: relative; }
.select-label::after { content: ""; position: absolute; right: 14px; top: calc(50% - 5px); width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none; }

.work-area, .game-area { max-width: 940px; margin: 27px auto 0; }
.subheading { display: flex; justify-content: space-between; align-items: center; gap: 15px; color: var(--muted); font-weight: 800; margin-bottom: 13px; }
.quiet-link { display: inline-flex; gap: 8px; align-items: center; min-height: 43px; padding: 5px 11px; border: 1px solid #e4dced; border-radius: 11px; background: white; color: #5b3b91; font-weight: 900; }
.quiet-link:hover, .practice-links a:hover { background: #f2eaff; }
.page-title { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 19px; }
.page-title h1, .game-heading h1 { color: var(--ink); font-weight: 1000; font-size: clamp(2.2rem, 4.8vw, 3.15rem); letter-spacing: -.05em; line-height: 1.06; }
.page-title p { color: var(--muted); margin-top: 5px; font-weight: 750; }
.topic-ar { color: var(--primary-deep); font-size: clamp(1.35rem, 4vw, 2.08rem); }
.study-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, 1fr); grid-template-rows: max-content 1fr; grid-template-areas: "card side" "controls side"; align-items: start; gap: 13px 15px; }
.word-card { grid-area: card; display: grid; grid-template-rows: 1fr auto; align-items: center; min-height: 400px; overflow: hidden; border: 1px solid var(--edge); border-radius: 25px; background: var(--tone); text-align: center; scroll-margin-top: 12px; }
.study-art { display: grid; place-items: center; min-height: 165px; padding: 20px 20px 14px; position: relative; }
.study-art::before { content: ""; position: absolute; width: 157px; height: 157px; border-radius: 50%; border: 1px solid #ffffff91; background: #ffffff4d; }
.study-art > * { position: relative; z-index: 1; }
.study-art .art { width: min(156px, 65%); height: 147px; filter: drop-shadow(0 8px 9px #26124825); }
.study-art:has(.photo)::before { content: none; }
.study-art .photo { width: min(360px, 100%); height: 204px; padding: 6px; border-radius: 17px; background: white; box-shadow: 0 5px 14px #2a19401b; }
.study-details { padding: 3px 16px 24px; }
.large-word { display: block; font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 800; line-height: 1.49; color: #3c2672; overflow-wrap: anywhere; }
.study-details .large-word { color: var(--accent); }
.translation { font-size: 1.18rem; font-weight: 900; color: var(--muted); }
.study-details .button { margin-top: 13px; }
.deck-side { grid-area: side; border: 1px solid var(--line); background: white; border-radius: 22px; padding: 13px; min-width: 0; }
.side-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 5px 11px; }
.side-title h2 { font-size: 1.19rem; }
.side-title > span { color: var(--muted); font-weight: 850; font-size: .88rem; white-space: nowrap; }
.word-list { display: grid; gap: 3px; }
.word-row { display: flex; align-items: center; min-height: 41px; gap: 7px; width: 100%; padding: 3px 7px; text-align: left; background: white; border: 1px solid transparent; border-radius: 10px; font-size: .9rem; font-weight: 850; }
.word-row:hover { background: #f8f4ff; }
.word-row.selected { background: #f0e9ff; border-color: #e4d6fb; color: #4a2f87; }
.word-row-art { display: grid; place-items: center; width: 29px; height: 29px; flex: none; }
.word-row-art .photo { width: 100%; height: 100%; border-radius: 5px; background: #fff; }
.word-row .arabic { margin-left: auto; text-align: right; font-size: .96rem; }
.word-row .swatch { width: 24px; }
.word-row .digit { font-size: 1.28rem; }
.check-dot { flex: none; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: #d7f5e4; color: #206647; font-size: .82rem; }
.deck-controls { grid-area: controls; display: flex; justify-content: space-between; gap: 8px; }
.practice-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 21px; }
.practice-links a { color: #533582; background: #f1ebf9; border: 1px solid #e9ddf5; padding: 8px 12px; border-radius: 10px; font-size: .9rem; font-weight: 850; }
.swatch { display: block; width: 94px; aspect-ratio: 1; border-radius: 31% 45% 42% 35%; transform: rotate(-10deg); border: 1px solid #20173220; background: var(--swatch); box-shadow: inset 1px 4px 8px #ffffff37, inset -3px -6px 9px #19142921, 0 4px 7px #281a3a20; }
.digit { display: grid; place-items: center; color: #7f5110; font: 800 5.8rem/1 'Noto Sans Arabic', Tahoma, sans-serif; }
.audio-error { margin: 10px auto 0; color: #8d2248; font-weight: 850; font-size: .91rem; text-align: center; }

.game-area { max-width: 760px; }
.game-heading { margin-bottom: 17px; }
.game-status { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 900; margin-bottom: 6px; }
.game-status > span:last-child { background: #fff4d9; color: #765011; border-radius: 9px; padding: 4px 9px; }
.milestones { display: flex; gap: 5px; margin-bottom: 14px; }
.milestones span { flex: 1; height: 8px; border-radius: 99px; background: #ece3f7; }
.milestones .filled { background: #8558d6; }
.game-board, .result-panel { text-align: center; padding: 21px 24px 19px; background: white; border: 1px solid var(--line); border-radius: 23px; box-shadow: 0 6px 24px #4224590a; }
.read-prompt, .listen-prompt { display: grid; justify-items: center; align-content: center; min-height: 119px; }
.read-prompt p, .listen-prompt p, .game-instruction { font-size: clamp(1rem, 2.6vw, 1.12rem); font-weight: 850; color: var(--muted); }
.picture-word { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 12px; width: 100%; }
.picture-word .large-word { min-width: 0; }
.picture-speaker { min-height: 44px; padding: 7px 12px; font-size: .9rem; }
.listen-button { margin-top: 12px; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 595px; margin: 15px auto 0; gap: 11px; }
.choice { position: relative; min-width: 0; aspect-ratio: 1.22; min-height: 78px; overflow: hidden; border-radius: 19px; background: var(--tone); border: 2px solid var(--edge); padding: 0; transition: transform .15s, border-color .15s, opacity .15s; }
.tile-visual { position: absolute; inset: 8px; display: grid; place-items: center; grid-template: minmax(0, 1fr) / minmax(0, 1fr); overflow: hidden; pointer-events: none; }
.tile-visual > * { min-width: 0; min-height: 0; max-height: 100%; }
.choice:enabled:hover { transform: translateY(-3px); border-color: #8155cb; }
.choice .art, .recall-art .art { width: min(98px, 82%); height: min(105px, 100%); }
.choice .photo { width: 100%; height: 100%; border-radius: 10px; background: white; }
.choice .swatch { width: min(84px, 73%); }
.choice .digit { font-size: clamp(2.1rem, 8vw, 4.8rem); }
.choice:disabled:not(.right, .wrong) { opacity: .64; }
.choice.right { border-color: #319368; }
.choice.wrong { border-color: #c76b83; opacity: .76; }
.choice-status { position: absolute; width: 25px; height: 25px; display: grid; place-items: center; top: 5px; right: 5px; border-radius: 50%; background: #226b49; color: white; font-weight: 1000; }
.choice.wrong .choice-status { background: #a32351; }
.game-feedback { min-height: 57px; display: flex; gap: 10px; align-items: center; justify-content: space-between; max-width: 595px; margin: 13px auto 0; }
.feedback-copy { min-width: 0; overflow-wrap: anywhere; font-weight: 800; text-align: left; }
.feedback-copy.correct { color: #216a48; }
.feedback-copy.try { color: #942353; }
.game-feedback .button { flex: none; }
.pairs-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 600px; margin: 16px auto 10px; }
.pair-tile { position: relative; display: grid; place-items: center; min-width: 0; min-height: 97px; aspect-ratio: 1.18; overflow: hidden; color: #6944aa; background: #ece2fc; border: 2px solid #dfd0f5; border-radius: 15px; font-size: 1.5rem; font-weight: 1000; padding: 5px; }
.pair-tile .tile-visual { inset: 4px; }
.pair-tile:enabled:hover { border-color: #936cdc; }
.pair-tile.open { background: #fff9df; border-color: #e6d19e; }
.pair-tile.matched { background: #e5f7e9; border-color: #b5e2c3; color: #226747; }
.pair-tile.mismatch { background: #fde8ef; border-color: #ec9cb8; }
.pair-tile .arabic { font-size: clamp(.74rem, 2.7vw, 1.42rem); overflow-wrap: anywhere; }
.pair-tile .art { width: min(71px, 100%); height: min(69px, 100%); }
.pair-tile .photo { width: 100%; height: 100%; border-radius: 8px; background: white; }
.pair-tile .swatch { width: min(57px, 82%); }
.pair-tile .digit { font-size: clamp(1.65rem, 7vw, 3.65rem); }
.pair-status { font-weight: 850; color: var(--muted); }
.memory-levels { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 15px; color: var(--muted); font-weight: 850; }
.memory-levels > span { margin-right: 3px; }
.memory-levels > a { display: grid; place-items: center; min-width: 44px; min-height: 44px; border: 1px solid #ded3f0; border-radius: 11px; background: white; color: #493378; }
.memory-levels > a:hover { background: #f0e9ff; }
.memory-levels > a[aria-current] { border-color: var(--primary); background: var(--primary); color: white; }
.memory-grid { max-width: 500px; }
.memory-grid.memory-size-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 252px; }
.memory-grid.memory-size-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 380px; }
.pair-check { position: absolute; right: 4px; top: 4px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; background: #226747; font-size: .84rem; }
.recall-art { width: 148px; height: 143px; display: grid; place-items: center; background: var(--tone); border-radius: 22px; margin: 15px auto; }
.recall-art .swatch { width: 78px; }
.recall-art:has(.photo) { width: min(246px, 100%); height: 163px; padding: 7px; }
.recall-art .photo { width: 100%; height: 100%; border-radius: 15px; background: white; }
.recall-art .digit { font-size: 4.6rem; }
.recall-answer { max-width: 550px; margin-inline: auto; }
.recall-answer .button { margin-top: 9px; }
.recall-controls, .result-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.result-panel { padding-block: 29px; }
.result-panel h2 { font-size: clamp(1.65rem, 5vw, 2.4rem); letter-spacing: -.04em; font-weight: 1000; }
.result-panel p { margin-top: 5px; color: var(--muted); font-weight: 750; }
.result-panel > .button { margin-top: 16px; }
.result-art { width: 116px; height: 106px; margin: 0 auto 8px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { display: grid; align-content: center; min-width: 0; padding: 15px 16px; min-height: 115px; border: 1px solid var(--edge); border-radius: 17px; background: var(--tone); font-weight: 850; color: var(--accent); }
.stat-deco { min-height: 21px; }
.stat strong { color: var(--ink); font-size: 2rem; line-height: 1.13; font-weight: 1000; }
.review-panel { display: flex; align-items: center; gap: 14px; background: white; border: 1px solid var(--line); border-radius: 20px; padding: 16px; margin-top: 15px; }
.review-panel h2 { font-size: 1.46rem; }
.review-panel p { color: var(--muted); font-weight: 750; line-height: 1.4; margin-top: 4px; }
.review-panel > .button { margin-left: auto; flex: none; }
.progress-heading { margin-top: 25px; }
.progress-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.progress-topic { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; background: white; border: 1px solid var(--line); border-radius: 15px; padding: 9px; font-weight: 850; }
.progress-topic:hover { border-color: var(--edge); background: var(--light); }
.progress-topic > span:last-child { color: var(--accent); }
.progress-topic progress { display: block; width: 100%; accent-color: var(--primary); margin-top: 4px; height: 8px; }

.footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 38px; padding: 16px 0 24px; border-top: 1px solid var(--line); }
.footer-brand { display: inline-flex; align-items: center; gap: 7px; color: #655777; font-weight: 1000; }
.footer .mark { width: 27px; height: 27px; border-radius: 8px; font-size: 1.12rem; padding-bottom: 2px; }
.text-button { border: 0; background: transparent; min-height: 43px; padding: 4px; color: var(--muted); font-size: .9rem; font-weight: 850; text-align: right; }
.text-button:hover { color: var(--primary); text-decoration: underline; }
dialog { width: min(600px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 20px; background: #fff; padding: 23px; color: var(--ink); box-shadow: 0 15px 80px #30214a50; }
dialog::backdrop { background: #30214a80; }
dialog h2 { line-height: 1.15; margin: 0 38px 12px 0; font-weight: 1000; }
dialog p + p, dialog h3 { margin-top: 12px; }
dialog ul { padding-left: 21px; margin-block: 6px 12px; }
dialog li + li { margin-top: 5px; }
dialog a { color: var(--primary-deep); text-decoration: underline; }
.close-button { position: absolute; top: 10px; right: 10px; width: 43px; height: 43px; border: 0; border-radius: 12px; background: #f3ebff; font-size: 1.55rem; line-height: 1; color: var(--primary-deep); }
.small-text { color: var(--muted); font-size: .88rem; }
.media-sources { margin: 11px 0; }
.media-sources summary { cursor: pointer; color: var(--primary-deep); font-weight: 850; }
.media-sources p { margin-top: 7px; }
#media-credit-list { margin-top: 8px; }
#media-credit-list details + details { margin-top: 6px; }
#media-credit-list ul { font-size: .93rem; }

@media (max-width: 950px) {
  .shell { width: calc(100% - 40px); }
  .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-copy { padding-left: 32px; }
  .hero { min-height: 310px; }
  .hero h1 { font-size: clamp(2.35rem, 5.3vw, 3.2rem); }
  .hero-copy p { font-size: 1.05rem; }
  .hello-bubble { right: 5%; top: 12%; }
}

@media (max-width: 720px) {
  .shell { width: calc(100% - 28px); }
  .header-layout { grid-template-columns: 1fr auto; min-height: 0; padding-block: 9px 6px; row-gap: 4px; }
  .brand { font-size: 1.29rem; }
  .brand .mark { width: 39px; height: 39px; font-size: 1.55rem; }
  .nav { grid-column: 1 / -1; grid-row: 2; width: 100%; justify-content: space-between; gap: 4px; }
  .nav a { padding: 7px 6px; gap: 6px; justify-content: center; flex: 1 1 auto; min-height: 41px; font-size: .96rem; }
  .star-total { min-height: 39px; }
  .hero { margin-top: 15px; grid-template-columns: 1fr; border-radius: 23px; }
  .hero-copy { padding: 20px 12px 3px; text-align: center; }
  .hero-actions { justify-content: center; gap: 8px; }
  .hero h1 { font-size: clamp(2rem, 8.5vw, 3.5rem); }
  .hero-copy p { margin: 8px auto 0; }
  .hero-actions { margin-top: 14px; }
  .hero-actions .button { min-height: 50px; padding-inline: 13px; }
  .hero-scene { min-height: 154px; max-width: 410px; width: 100%; margin-inline: auto; }
  .scene-halo { width: 48%; left: 24%; top: 8%; }
  .fox { height: 108%; width: 96%; right: 7%; bottom: -5%; }
  .hello-bubble { padding: 7px 10px; min-width: 0; right: 9%; top: 24%; border-radius: 13px 13px 13px 4px; gap: 5px; }
  .hello-bubble .arabic { font-size: 1.13rem; }
  .hello-bubble small { font-size: .72rem; }
  .sparkle-top { top: 25%; left: 16%; font-size: 1.2rem; }
  .sparkle-side { top: 68%; right: 12%; font-size: 1rem; }
  .section { margin-top: 25px; }
  .section-heading { gap: 9px; margin-bottom: 12px; }
  .section-heading p { font-size: .96rem; }
  .topics-grid, .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .topic-card { min-height: 127px; border-radius: 15px; padding: 9px; }
  .tile-art { width: 47px; height: 51px; }
  .tile-arabic { font-size: .89rem; }
  .tile-bottom :is(h2, h3) { font-size: 1.08rem; }
  .tile-bottom > span { font-size: .84rem; }
  .game-card { padding: 10px; border-radius: 15px; min-height: 142px; }
  .game-card h2 { font-size: 1.03rem; }
  .game-card p { font-size: .89rem; }
  .select-label { align-self: flex-end; }
  .select-label > span { display: none; }
  .select-label select { max-width: 130px; padding-left: 7px; font-size: .88rem; }
  .work-area, .game-area { margin-top: 17px; }
  .study-layout { grid-template-columns: 1fr; grid-template-rows: auto; grid-template-areas: "card" "controls" "side"; gap: 11px; }
  .word-card { min-height: 292px; grid-template-rows: 1fr auto; }
  .study-art { min-height: 125px; padding: 12px 12px 5px; }
  .study-art::before { width: 108px; height: 108px; }
  .study-art .art { width: 110px; height: 109px; }
  .study-art .photo { width: min(286px, 100%); height: 149px; border-radius: 13px; }
  .study-details { padding-bottom: 16px; }
  .study-details .button { margin-top: 9px; }
  .deck-controls { gap: 6px; }
  .deck-controls .button { padding: 7px 8px; min-height: 44px; font-size: .86rem; flex: 1 1 auto; }
  .practice-links { margin-top: 13px; }
  .practice-links a { padding: 7px 8px; font-size: .82rem; }
  .game-board, .result-panel { padding: 13px 10px; border-radius: 17px; }
  .read-prompt, .listen-prompt { min-height: 96px; }
  .choices, .pairs-grid { gap: 6px; }
  .choice { border-radius: 12px; }
  .tile-visual { inset: 4px; }
  .game-feedback { min-height: 46px; margin-top: 9px; }
  .game-feedback .button { min-height: 44px; padding-inline: 12px; }
  .pair-tile { min-height: 66px; border-radius: 10px; line-height: 1.15; }
  .stats-grid { gap: 6px; }
  .stat { padding: 10px 6px 10px 9px; min-height: 106px; border-radius: 12px; font-size: .88rem; line-height: 1.17; }
  .review-panel { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; padding: 10px; }
  .review-panel > .button { grid-column: 1 / -1; justify-self: stretch; margin-left: 0; }
  .progress-grid { grid-template-columns: 1fr; }
  .footer { margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
