/* «يلا نتعلم», Lughati: every word a child reads is in a Naskh with clear marks, the kind of letters the school book teaches, with room
   between the lines for its marks. Loaded after learn/lesson.css and learn/lesson-ar.css. */
body.kplay { --naskh: "Noto Naskh Arabic", "IBM Plex Sans Arabic", serif; }
.plTalk, .plTalkBig, .plOpt, .plTile, .arQ, .arWhy, .arCard, .arBin b, .arLine, .lgPart, .lgName, .lgLine, .lgRead, .lgRuleLine, .lgWord, .lgMini, .lgGapLine, .lgKey,
.lgTag, .lgModel, .lgEar, .lgTyped, .lgSaidLine, .lgThing span, .lgSaying, .lgEvent, .lgDone span, .lgAgain, .plLookRow b { font-family: var(--naskh); }
.plTalk { font-size: 1.14rem; font-weight: 700; line-height: 1.95; padding-block: 6px; }
.plTalkBig { font-size: 1.18rem; line-height: 2; }
.plOpt, .plOpts .plOpt { font-size: 1.28rem; line-height: 1.9; padding-block: 8px; }
.plHello h2 { font-size: clamp(1.6rem, 6.6vw, 2.2rem); }
.arPair .plTile, .arPair .plTile.word, .plTile { font-family: var(--naskh); font-size: clamp(1rem, 4.4vw, 1.15rem); font-weight: 700; line-height: 1.85; }
.arQ { font-size: clamp(1.2rem, 5vw, 1.4rem); line-height: 1.95; }
.arWhy { line-height: 1.95; font-size: 1.08rem; }
.plLookRow { direction: rtl; }
.plLookRow b { line-height: 1.9; font-size: 1.08rem; }
.arBin b { font-weight: 700; font-size: clamp(.98rem, 4.3vw, 1.16rem); line-height: 1.8; }

/* the book's heading over each part of a lesson */
.lgPart { flex: none; align-self: center; padding: 1px 14px; border-radius: 999px; background: rgba(255, 255, 255, .78); color: #0B6F73; font-weight: 700; font-size: .92rem; line-height: 1.9; }

/* the story's stage: the street, in a window over the words */
.lgStage { position: sticky; top: 0; z-index: 2; flex: none; overflow: hidden; width: 100%; aspect-ratio: 16 / 7.4; border-radius: 22px; background: linear-gradient(180deg, #CDEEFF 0, #EAF8FF 62%, #FFF5DA 62%, #FFE7AE 100%); box-shadow: 0 5px 0 var(--line), 0 10px 22px rgba(27, 42, 74, .12); }
.lgGround { position: absolute; inset: auto 0 0; height: 26%; background: linear-gradient(180deg, #B9C4D2, #A5B1C2); }
.lgGround::after { content: ""; position: absolute; left: 0; right: 0; top: 46%; border-top: 3px dashed rgba(255, 255, 255, .8); }
.lgWho { position: absolute; left: 50%; bottom: 5%; transform: translateX(-50%); filter: drop-shadow(0 3px 2px rgba(27, 42, 74, .28)); transition: left .9s cubic-bezier(.4, .1, .3, 1), bottom .9s cubic-bezier(.4, .1, .3, 1), opacity .45s ease; }
.lgPop { position: absolute; width: 11%; transform: translateX(-50%); filter: drop-shadow(0 2px 2px rgba(27, 42, 74, .28)); animation: lgPop 1.6s ease forwards; }
@keyframes lgPop { 0% { opacity: 0; transform: translate(-50%, 8px) scale(.5); } 18% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 30% { transform: translate(-50%, 0) scale(1); } 100% { opacity: 1; transform: translate(-50%, 0); } }
.lgSheet { flex: none; display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 20px; background: #fff; box-shadow: 0 5px 0 var(--line); }
.lgName { margin: 0; color: #B0460C; font-weight: 700; font-size: 1.32rem; line-height: 2; text-align: center; }
.lgLine { display: block; width: 100%; padding: 2px 8px; border: 0; border-radius: 12px; background: none; color: inherit; font-size: clamp(1.18rem, 5vw, 1.34rem); font-weight: 500; line-height: 2.05; text-align: start; cursor: pointer; transition: background .25s; }
.lgLine.on { background: #FFF0B3; font-weight: 700; }
.lgAgainTip { padding-top: 2px; color: var(--soft); font-family: var(--naskh); font-size: .94rem; line-height: 1.9; text-align: center; }
.lgLine:focus-visible, .lgReadLine:focus-visible, .lgRuleRow:focus-visible, .lgGapLine:focus-visible, .lgKey:focus-visible, .lgModel:focus-visible, .lgEar:focus-visible, .lgSaidLine:focus-visible, .lgThing:focus-visible, .lgSaying:focus-visible, .lgEvent:focus-visible, .lgAgain:focus-visible, .lgCard:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* a part of a word in colour */
.lgWord i { font-style: normal; }
.lgHi { color: #D9480F; }
.lgOff { color: #A9B4C4; }

/* read aloud */
.lgRead { flex: none; padding: 10px; border-radius: 20px; background: #fff; box-shadow: 0 5px 0 var(--line); }
.lgReadLine { display: block; width: 100%; padding: 4px 6px; border: 0; background: none; color: inherit; font: inherit; font-size: clamp(1.3rem, 5.6vw, 1.55rem); font-weight: 700; line-height: 2.1; text-align: center; cursor: pointer; }

/* a rule */
.lgRule { flex: none; display: flex; flex-direction: column; gap: 12px; }
.lgRuleRow { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; padding: 10px 12px; border: 0; border-radius: 20px; background: #fff; color: inherit; font: inherit; box-shadow: 0 5px 0 var(--line); cursor: pointer; transition: opacity .3s, transform .3s; }
.lgRuleRow.wait { opacity: 0; transform: translateY(12px); }
.lgRuleHead { display: flex; align-items: center; justify-content: center; gap: 10px; }
.lgRulePic { width: 54px; flex: none; filter: drop-shadow(0 3px 3px rgba(27, 42, 74, .22)); }
.lgRuleHead .lgWord { font-size: clamp(1.7rem, 8vw, 2.3rem); font-weight: 700; line-height: 1.9; }
.lgRuleLine { font-size: clamp(1.08rem, 4.6vw, 1.22rem); font-weight: 500; line-height: 1.95; text-align: center; }
/* a whole sentence in a rule's head */
.lgRuleRow .lgRuleHead { flex-wrap: wrap; }

/* words to sort */
.lgSortStage { min-height: 96px; min-height: clamp(96px, 18dvh, 150px); align-items: center; }
.lgCard { padding: 2px 30px; border: 0; color: inherit; font-size: clamp(1.8rem, 8.4vw, 2.4rem); font-weight: 700; line-height: 1.9; cursor: pointer; }
.lgMini { padding: 0 7px; border-radius: 8px; background: #FFF6CF; font-size: .86rem; font-weight: 700; line-height: 1.8; }

/* fill the gap */
.lgScene { flex: none; display: flex; align-items: flex-end; justify-content: space-around; gap: 8px; padding: 8px 12px; border-radius: 20px; background: linear-gradient(180deg, #E5F6FF 0 72%, #FFE7AE 72% 100%); box-shadow: 0 5px 0 var(--line); }
.lgScene[hidden] { display: none; }
.lgScenePic { width: 27%; max-width: 110px; filter: drop-shadow(0 3px 3px rgba(27, 42, 74, .22)); }
.lgGap { flex: none; display: flex; justify-content: center; }
.lgGapLine { display: block; max-width: 100%; padding: 8px 22px; border: 0; border-radius: 22px; background: #fff; color: inherit; font-size: clamp(2.3rem, 11vw, 3.1rem); font-weight: 700; line-height: 1.75; box-shadow: 0 6px 0 var(--line), 0 12px 22px rgba(27, 42, 74, .1); cursor: pointer; }
.lgGapLine.long { padding: 8px 14px; font-size: clamp(1.32rem, 5.8vw, 1.6rem); line-height: 2.2; font-weight: 700; }
.lgGapLine.won { background: var(--okBg); }
.lgBlank { display: inline-block; width: .62em; height: .9em; margin-inline: .06em; border: 3px dashed #F2A65A; border-radius: 10px; background: #FFF6CF; vertical-align: -.08em; }
.lgBlank.wide { width: 3.4em; border-width: 2.5px; vertical-align: -.2em; }
.lgKeys { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.lgKey { flex: none; min-width: 72px; height: 72px; padding: 0 8px; border: 0; border-radius: 18px; background: #fff; color: inherit; font-size: 2.1rem; font-weight: 700; line-height: 1; box-shadow: 0 5px 0 var(--line); cursor: pointer; touch-action: manipulation; }
.lgKey:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--line); }
.lgKey.ok { background: var(--okBg); color: #0B6B49; box-shadow: 0 5px 0 var(--okD); animation: plYes .4s ease; }
.lgKey.no { background: var(--noBg); color: #A32A2E; box-shadow: 0 5px 0 var(--noD); animation: plNo .4s ease; }
.lgKey:disabled:not(.ok):not(.no) { color: #8493AA; }
.lgKeys.many .lgKey { min-width: 58px; width: 58px; height: 58px; font-size: 1.85rem; border-radius: 15px; }
.lgKeys.many .lgKey.used { visibility: hidden; }
.lgKeys.off { opacity: .45; }

/* dictation */
.lgTag { flex: none; align-self: center; padding: 0 12px; border-radius: 10px; background: #FFF3C4; color: #6B4F00; font-weight: 700; font-size: .95rem; line-height: 1.9; }
.lgLook { flex: none; display: flex; justify-content: center; min-height: 66px; }
.lgModel { padding: 0 26px; border: 0; border-radius: 20px; background: #fff; color: inherit; font-size: clamp(2.1rem, 10vw, 2.7rem); font-weight: 700; line-height: 1.8; box-shadow: 0 5px 0 var(--line); cursor: pointer; transition: opacity .4s; }
.lgModel.gone { opacity: 0; pointer-events: none; }
.lgEar { align-self: center; padding: 6px 22px; border: 0; border-radius: 16px; background: var(--blue); color: #fff; font-size: 1.1rem; font-weight: 700; line-height: 1.8; box-shadow: 0 5px 0 #1F5FC4; cursor: pointer; }
.lgLine2 { flex: none; display: flex; align-items: center; justify-content: center; min-height: 84px; padding: 2px 16px; border-radius: 20px; background: #fff; border-bottom: 4px solid #F08A80; box-shadow: 0 5px 0 var(--line); }
.lgLine2.won { background: var(--okBg); }
.lgTyped { font-size: clamp(2.4rem, 11vw, 3.1rem); font-weight: 700; line-height: 1.6; }

/* what «إلا» took out */
.lgSaid { flex: none; display: flex; align-items: center; gap: 8px; }
.lgSaidLine { flex: 1; min-width: 0; padding: 6px 12px; border: 0; border-radius: 18px; background: #fff; color: inherit; font-size: clamp(1.26rem, 5.4vw, 1.5rem); font-weight: 700; line-height: 2; box-shadow: 0 5px 0 var(--line); cursor: pointer; }
.lgHero { flex: none; width: 76px; filter: drop-shadow(0 3px 3px rgba(27, 42, 74, .22)); }
.lgThings { flex: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lgThing { position: relative; display: flex; flex-direction: column; align-items: center; padding: 8px 6px 2px; border: 0; border-radius: 20px; background: #fff; color: inherit; font-size: 1.1rem; font-weight: 700; line-height: 1.8; box-shadow: 0 5px 0 var(--line); cursor: pointer; transition: transform .7s ease, opacity .7s ease; }
.lgThingPic { width: min(24vw, 96px); filter: drop-shadow(0 3px 3px rgba(27, 42, 74, .2)); }
.lgThing.ok { background: var(--okBg); box-shadow: 0 5px 0 var(--okD); animation: plYes .5s ease; }
.lgThing.no { background: var(--noBg); box-shadow: 0 5px 0 var(--noD); animation: plNo .4s ease; }
.lgThing.eat { opacity: 0; transform: translateY(-60px) scale(.35); }
.lgThing.sleep { filter: grayscale(.7) brightness(.82); }
.lgThing.sleep::after { content: "ز ز ز"; position: absolute; top: 8px; inset-inline-end: 12px; color: #5B6B86; font-size: 1rem; font-weight: 700; }
.lgThing.fly { opacity: 0; transform: translateY(-110px) rotate(-8deg); }

/* writing with the finger */
.lgSaying { flex: none; display: flex; flex-direction: column; align-items: center; padding: 2px 10px; border: 0; border-radius: 18px; background: #fff; color: inherit; box-shadow: 0 5px 0 var(--line); cursor: pointer; }
.lgSaying b { color: #0B6F73; font-size: clamp(1.3rem, 5.8vw, 1.55rem); font-weight: 700; line-height: 2; }
.lgSaying small { color: var(--soft); font-size: .9rem; line-height: 1.7; }
.lgSaying.long b { font-size: clamp(1.08rem, 4.8vw, 1.25rem); line-height: 1.9; }
.lgPad { flex: none; display: block; width: 100%; border-radius: 20px; background: #fff; box-shadow: 0 5px 0 var(--line); touch-action: none; cursor: crosshair; }
.lgAgain { flex: none; align-self: center; padding: 2px 18px; border: 0; border-radius: 14px; background: #fff; color: var(--soft); font-size: 1rem; font-weight: 700; line-height: 1.9; box-shadow: 0 3px 0 var(--line); cursor: pointer; }
.lgAgain[hidden] { display: none; }

/* the events in order */
.lgList { flex: none; display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.lgList:empty { display: none; }
.lgDone { display: flex; align-items: center; gap: 8px; padding: 2px 10px; border-radius: 14px; background: var(--okBg); animation: plWave .3s ease-out; }
.lgDone b { flex: none; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ok); color: #fff; font: 700 1.05rem/1 var(--naskh); }
.lgDone span { font-size: clamp(1.06rem, 4.6vw, 1.2rem); font-weight: 700; line-height: 1.9; }
.lgPool { flex: none; display: flex; flex-direction: column; gap: 10px; }
.lgEvent { width: 100%; padding: 6px 12px; border: 0; border-radius: 16px; background: #fff; color: inherit; font-size: clamp(1.12rem, 4.8vw, 1.28rem); font-weight: 700; line-height: 1.9; box-shadow: 0 5px 0 var(--line); cursor: pointer; }
.lgEvent.no { background: var(--noBg); box-shadow: 0 5px 0 var(--noD); animation: plNo .4s ease; }

@media (prefers-reduced-motion: reduce) {
  .lgWho, .lgThing, .lgRuleRow { transition: none; }
  .lgPop, .lgDone { animation: none; }
}

/* read a line at a time: the next ones wait */
.lgSheet .later { display: none; }

/* heard only: the text stays hidden, and its stage acts it */
.lgSheet.hide .lgLine { display: none; }
.lgSheet.hide { text-align: center; padding-bottom: 14px; }
/* verses: two halves on a line each */
.lgVerse { display: flex; flex-direction: column; align-items: center; gap: 0; text-align: center; }
.lgVerse span { display: block; }
.lgVerse span + span { color: #355; }

/* a picture to talk about */
.lgTalks { flex: none; display: flex; flex-direction: column; gap: 8px; }
.lgTalk { display: block; width: 100%; padding: 8px 14px; border: 0; border-radius: 16px; background: #fff; color: inherit; font: 700 1.08rem/1.8 var(--naskh); text-align: start; box-shadow: 0 4px 0 var(--line); cursor: pointer; transition: opacity .25s, transform .25s; }
.lgTalk.wait { opacity: 0; transform: translateY(10px); pointer-events: none; }

/* touching a word in a sentence */
.lgTapLine { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 14px 10px; border-radius: 20px; background: #fff; box-shadow: 0 5px 0 var(--line); }
.lgTapWord { padding: 4px 12px; border: 0; border-radius: 12px; background: #EEF8FF; color: inherit; font: 700 1.3rem/1.9 var(--naskh); cursor: pointer; box-shadow: 0 3px 0 #CDE7F7; }
.lgTapWord.ok { background: var(--okBg); color: #0B6B49; box-shadow: 0 3px 0 var(--okD); }
.lgTapWord.no { animation: plNo .4s ease; background: var(--noBg); }

/* a sentence from its words */
.lgBuilt { flex: none; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; min-height: 64px; padding: 10px; border: 3px dashed #8FD0F5; border-radius: 20px; background: rgba(255, 255, 255, .82); font: 700 1.25rem/1.9 var(--naskh); }
.lgBuilt.won { border: 3px solid var(--okD); background: var(--okBg); color: #0B6B49; }
.lgBuiltWord { padding: 0 2px; }
.lgWords { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.lgWordTile { padding: 6px 14px; border: 0; border-radius: 14px; background: #fff; color: inherit; font: 700 1.2rem/1.8 var(--naskh); box-shadow: 0 4px 0 var(--line); cursor: pointer; }
.lgWordTile.used { visibility: hidden; }
.lgWordTile.no { animation: plNo .4s ease; background: var(--noBg); }

/* a word's map */
.lgMapWord { flex: none; align-self: center; padding: 4px 30px; border: 0; border-radius: 18px; background: linear-gradient(180deg, #FFF8DC, #FFEDA6); color: inherit; font: 700 1.7rem/1.8 var(--naskh); box-shadow: 0 5px 0 #E8C75A; cursor: pointer; }
.lgMapRows { flex: none; display: flex; flex-direction: column; gap: 6px; }
.lgMapRow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 14px; border-radius: 14px; background: rgba(255, 255, 255, .7); font: 700 1.05rem/1.8 var(--naskh); }
.lgMapRow.on { background: #fff; box-shadow: 0 0 0 3px var(--sun); }
.lgMapValue { color: #0B6B49; font-size: 1.2rem; min-width: 70px; text-align: center; }

/* the book's four lines */
.lgLinesPad { flex: none; touch-action: auto; cursor: default; }
.lgLineRows { flex: none; display: flex; flex-direction: column; gap: 8px; }
.lgLineRow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: 0; border-radius: 16px; background: #fff; color: inherit; font: 700 1.02rem/1.8 var(--naskh); text-align: start; box-shadow: 0 4px 0 var(--line); cursor: pointer; transition: opacity .25s, transform .25s; }
.lgLineRow.wait { opacity: 0; transform: translateY(10px); pointer-events: none; }
.lgLineDot { flex: none; width: 16px; height: 16px; border-radius: 50%; }

/* three baskets, and a phrase to sort */
.arBins.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.arBins.n3 .arBin b { font-size: 1.15rem; }
.lgCard.long { padding: 10px 18px; font-size: 1.2rem; line-height: 1.8; max-width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .lgTalk, .lgLineRow { transition: none; }
  .lgTapWord.no, .lgWordTile.no { animation: none; }
}
