/*! GreatEDU learning library + brain games. Same visual language as the app (bold outlines, flat shadows). */

/* ---------- RTL ---------- */
[dir="rtl"] .top,[dir="rtl"] .row,[dir="rtl"] .list li{flex-direction:row-reverse}
[dir="rtl"] .list li{text-align:right}
[dir="rtl"] .gel-tile,[dir="rtl"] .gel-story,[dir="rtl"] .gel-q{text-align:right}
[dir="rtl"] .kg-ws,[dir="rtl"] .kg-sdk,[dir="rtl"] .kg-maze,[dir="rtl"] .kg-arrows,[dir="rtl"] .kg-simon{direction:ltr}
[dir="rtl"] ol,[dir="rtl"] ul{padding-right:22px;padding-left:0}
.ge-rtl .gel-pager{flex-direction:row-reverse}

/* ---------- shared ---------- */
.gel-busy{display:flex;align-items:center;gap:10px;padding:22px 4px;color:var(--muted)}
.gel-spin{width:20px;height:20px;border:3px solid rgba(17,17,17,.2);border-top-color:#111;border-radius:50%;animation:gelspin .8s linear infinite}
@keyframes gelspin{to{transform:rotate(360deg)}}
.gel-err{background:#FFE0E0!important;transform:none!important;text-align:left}
.gel-ro{background:var(--sun)!important;transform:none!important;text-align:left;margin:14px 0}
.gel-ro p{margin:6px 0 10px}
.gel-tr{font-size:13px;color:#7A4B00;background:#FFF1C9;border:2px dashed #C08A00;border-radius:12px;padding:6px 10px;margin:10px 0}
.gel-pill{display:inline-block;font-size:12px;font-weight:800;padding:3px 10px;border:2px solid #111;border-radius:99px;background:#fff;white-space:nowrap}
.gel-pill.ok{background:#C6FF3D}.gel-pill.warn{background:#FFE14D}
.gel-pill.st-learning{background:#6FD3FF}.gel-pill.st-practising{background:#FFB36B}.gel-pill.st-mastered{background:#C6FF3D}.gel-pill.st-completed{background:#C6FF3D}
.gel-good{color:#0B6B2E;font-weight:800;margin-top:10px}
.gel-bad{color:#9C1C1C;font-weight:800;margin-top:10px}
#app .card.gel-q,#app .gel-wordcard,#app .gel-tech,#app .gel-story,#app .gel-news,#app .gel-set,#app .gel-report,#app .gel-promise,#app .gel-plan,#app .gel-try,#app .gel-hero,#app .gel-wod,#app .gel-moral,#app .gel-done,#app .gel-flash,#app .kg-intro,#app .kg-q{transform:none;text-align:left;margin-top:14px;background:#fff}
#app .gel-hero,#app .gel-wod{background:var(--lime)}
#app .gel-moral{background:var(--sun)}
#app .gel-done{text-align:center}
.card p+p,.card ul,.card ol{margin-top:8px}
.card ol,.card ul{padding-left:22px}
.card li{margin:4px 0}
.card h3{font-size:17px;margin:14px 0 4px}
.gel-inline{display:flex;gap:8px;margin-top:10px}
.gel-inline input{flex:1;min-width:0;min-height:52px;border:var(--bd);border-radius:14px;padding:0 14px;font-size:20px;background:#fff}
.gel-search{display:flex;gap:8px;margin:14px 0}
.gel-search input{flex:1;min-width:0;min-height:52px;border:var(--bd);border-radius:16px;padding:0 14px;background:#fff;box-shadow:3px 3px 0 #111}
.gel-sel{display:block;margin:12px 0}
.gel-sel span{display:block;font-size:14px;font-weight:800;margin-bottom:4px}
.gel-sel select{width:100%;min-height:50px;border:var(--bd);border-radius:14px;padding:0 12px;background:#fff}
.gel-set textarea,.gel-promise textarea{width:100%;border:var(--bd);border-radius:14px;padding:10px;margin-top:6px;background:#fff;resize:vertical}
.gel-promise label{display:block;margin-top:12px;font-weight:700}
.gel-acts{flex-wrap:wrap;gap:8px}
.gel-pager{align-items:center;justify-content:space-between}
.gel-pager span{font-weight:800;font-size:14px}
.gel-big{font-size:24px;font-weight:800;line-height:1.3}
.gel-src{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:10px}
.gel-src small{display:inline}

/* ---------- learn hub ---------- */
.gel-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}
.gel-grid.sm{grid-template-columns:repeat(2,minmax(0,1fr))}
.gel-tile{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-height:112px;padding:14px;border:var(--bd);border-radius:20px;background:#fff;box-shadow:var(--hs);text-align:left;transition:transform .08s,box-shadow .08s}
.gel-grid.sm .gel-tile{min-height:64px;justify-content:center}
.gel-tile>span{font-size:30px;line-height:1}
.gel-tile b{font-size:16px;line-height:1.2}
.gel-tile small{font-size:12px}
.gel-tile:active{transform:translate(4px,4px);box-shadow:0 0 0 #111}
.gel-grid .gel-tile:nth-child(6n+1){background:#6FD3FF}.gel-grid .gel-tile:nth-child(6n+2){background:#FFB36B}.gel-grid .gel-tile:nth-child(6n+3){background:#B79CFF}.gel-grid .gel-tile:nth-child(6n+4){background:#7CF2B2}.gel-grid .gel-tile:nth-child(6n+5){background:var(--sun)}.gel-grid .gel-tile:nth-child(6n){background:#fff}
.gel-tile.rec{outline:3px dashed var(--pink);outline-offset:3px}
.gel-plan-h{display:flex;justify-content:space-between;align-items:center;gap:12px}
.gel-plan h2{margin:4px 0 8px}
.gel-ring{--p:0;flex:none;width:70px;height:70px;border-radius:50%;border:var(--bd);background:conic-gradient(var(--lime) calc(var(--p)*1%),#fff 0);display:grid;place-items:center}
.gel-ring b{background:#fff;border:2px solid #111;border-radius:99px;padding:2px 8px;font-size:15px!important}
.gel-tasks li.done{opacity:.75}
.gel-tasks li .gel-ic{background:#fff!important}
.gel-mini{display:flex!important;align-items:center;gap:12px;width:100%;margin:16px 0;text-align:left!important;transform:none!important;background:#fff!important}
.gel-mini>span:first-child{font-size:28px}
.gel-mini div{flex:1}
.gel-mini b{font-size:17px!important}

/* ---------- words ---------- */
.gel-word{font-size:40px!important;line-height:1.1;overflow-wrap:break-word;word-break:normal}
.gel-wh{display:flex;flex-wrap:wrap;justify-content:space-between;gap:10px;align-items:flex-start}
.gel-wh>div:first-child{min-width:0;flex:1 1 160px}
.gel-wbtn{display:flex;gap:8px}
.gel-wbtn .btn{min-height:48px;padding:0 12px;font-size:20px}
.gel-say{margin-top:4px;font-size:14px}
.gel-mean{font-size:19px;margin-top:12px}
.gel-flash{text-align:center!important;min-height:220px;display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:12px}
.gel-flash.back{background:#F3FFE0!important}
.gel-opts{display:grid;gap:10px;margin-top:12px}
.gel-opts .btn{min-height:56px;justify-content:flex-start;text-align:left;padding:10px 16px;font-size:17px;line-height:1.3}
.gel-blank{font-size:20px;margin-top:8px;padding:10px;border:2px dashed #111;border-radius:12px;background:#FFFBEA}
.gel-build{min-height:56px;font-size:20px;padding:10px;border:2px dashed #111;border-radius:12px;background:#FFFBEA;margin:10px 0}
.gel-items li small{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* ---------- maths / stories ---------- */
.gel-ex{margin-top:10px;border:2px solid #111;border-radius:14px;padding:8px 12px;background:#F5FBFF}
.gel-ex summary,.card details summary{cursor:pointer;font-weight:800}
.gel-story p{font-size:18px;line-height:1.7;margin-top:12px}
.gel-story.size1 p{font-size:21px}.gel-story.size2 p{font-size:25px}
.gel-story h2{margin-top:8px}

/* ---------- promise / progress ---------- */
.gel-prom li.on{background:#F3FFE0}
.gel-promise.done{background:#F3FFE0!important}
.gel-days{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;margin:8px 0}
.gel-days span{display:grid;place-items:center;height:38px;border:2px solid #111;border-radius:10px;background:#fff;font-size:18px}
.gel-days span.on{background:var(--sun)}
.gel-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0}
.gel-stat{border:2px solid #111;border-radius:16px;background:#fff;padding:10px 12px;box-shadow:3px 3px 0 #111}
.gel-stat b{display:block;font-size:26px}
.gel-badges{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.gel-badge{border:2px solid #111;border-radius:16px;padding:10px;background:#eee;opacity:.7}
.gel-badge.on{background:var(--sun);opacity:1;box-shadow:3px 3px 0 #111}
.gel-badge span{font-size:26px}
.gel-badge b{display:block;font-size:15px}
.gel-who{display:grid;gap:8px}
.gel-news h2{margin-top:6px;background:none;font-size:20px}

/* ---------- brain games ---------- */
.kg-root{padding-bottom:20px}
.kg-head{display:flex;align-items:center;gap:10px;padding-top:calc(20px + env(safe-area-inset-top))}
.kg-head h1{font-size:clamp(22px,7vw,32px);line-height:1.1;letter-spacing:-.03em;min-width:0;overflow-wrap:anywhere}
.kg-intro ol{margin:8px 0 14px;padding-left:22px}
.kg-opts{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}
.kg-check{display:flex;align-items:center;gap:10px;margin:10px 0;font-weight:700}
.kg-check input{width:22px;height:22px}
.kg-best{margin:8px 0;font-weight:800}
.kg-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin:14px 0 10px}
.kg-stat{font-weight:800;font-size:14px}
.kg-clock{font-weight:800;font-variant-numeric:tabular-nums;border:2px solid #111;border-radius:10px;padding:2px 8px;background:#fff}
.kg-tools{display:flex;gap:6px}
.kg-tools .chip{min-height:40px;padding:0 10px}
.kg-board{position:relative}
.kg-done{position:fixed;inset:0;z-index:60;display:grid;place-items:center;padding:16px;background:rgba(17,17,17,.55)}
.kg-done .card{max-width:420px;width:100%;text-align:center;transform:none;background:#fff}
.kg-burst{font-size:64px;line-height:1;margin-bottom:6px}
.kg-q{text-align:center!important}
.kg-big{font-size:26px;font-weight:800;line-height:1.3}
.kg-opts4{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
.kg-opts4 .btn{min-height:64px;font-size:22px}
.kg-ok{background:#C6FF3D!important;animation:kgpop .3s}
.kg-no{background:#FF8A8A!important;animation:kgshake .3s}
@keyframes kgpop{50%{transform:scale(1.06)}}
@keyframes kgshake{25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}
/* memory */
.kg-mem{display:grid;grid-template-columns:repeat(var(--c),minmax(0,1fr));gap:8px}
.kg-card{aspect-ratio:1;border:var(--bd);border-radius:14px;background:#B79CFF;box-shadow:3px 3px 0 #111;font-size:clamp(24px,8vw,36px);display:grid;place-items:center}
.kg-card.on{background:#fff}.kg-card.got{background:#C6FF3D}
/* sudoku */
.kg-sdk{display:grid;grid-template-columns:repeat(var(--n),minmax(0,1fr));border:3px solid #111;border-radius:10px;overflow:hidden;background:#fff;max-width:440px;margin:0 auto}
.kg-cell{aspect-ratio:1;border-right:1px solid #999;border-bottom:1px solid #999;font-size:clamp(16px,5vw,26px);font-weight:800;color:#2449C7;display:grid;place-items:center;min-width:0}
.kg-cell.given{color:#111;background:#F4F1E8}
.kg-cell.sel{background:#FFE14D}
.kg-cell.bad{color:#C01818;background:#FFD6D6}
.kg-cell.br{border-right:3px solid #111}.kg-cell.bb{border-bottom:3px solid #111}
.kg-pad{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:12px}
.kg-pad .btn{min-height:52px;padding:0;font-size:22px}
/* word search */
.kg-ws{display:grid;grid-template-columns:repeat(var(--n),minmax(0,1fr));gap:2px;max-width:460px;margin:0 auto;border:3px solid #111;border-radius:10px;padding:4px;background:#fff}
.kg-l{aspect-ratio:1;font-weight:800;font-size:clamp(12px,4vw,20px);border-radius:6px;min-width:0}
.kg-l.sel{background:#FFE14D;outline:2px solid #111}
.kg-l.got{background:#C6FF3D}
.kg-words{list-style:none;display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.kg-words li{border:2px solid #111;border-radius:99px;padding:3px 10px;background:#fff;font-weight:800;text-transform:uppercase;font-size:14px}
.kg-words li.got{background:#C6FF3D;text-decoration:line-through}
/* scramble / sentence tiles */
.kg-tiles,.kg-ans{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:12px}
.kg-tile{min-width:48px;height:52px;padding:0 10px;border:var(--bd);border-radius:12px;background:var(--sun);box-shadow:3px 3px 0 #111;font-size:22px;font-weight:800}
.kg-tile.wide{font-size:17px}
.kg-tile.ans{background:#fff;border-style:dashed}
.kg-tile:disabled{opacity:.35;box-shadow:none}
.kg-ans.kg-ok .kg-tile{background:#C6FF3D}.kg-ans.kg-no .kg-tile{background:#FF8A8A}
/* logic */
.kg-clues{text-align:left;margin:4px 0 10px;padding-left:22px}
.kg-qm{display:inline-block;border:2px dashed #111;border-radius:8px;padding:0 8px}
/* concentration */
.kg-focus{display:grid;grid-template-columns:repeat(var(--c),minmax(0,1fr));gap:6px;margin-top:10px}
.kg-f{aspect-ratio:1;border:2px solid #111;border-radius:10px;background:#fff;font-size:clamp(18px,6vw,28px)}
.kg-f.got{background:#C6FF3D}
/* speed */
.kg-form{display:flex;gap:8px;margin-top:12px}
.kg-form input{flex:1;min-width:0;min-height:56px;border:var(--bd);border-radius:14px;padding:0 14px;font-size:26px;text-align:center}
/* maze */
.kg-maze{display:grid;grid-template-columns:repeat(var(--n),minmax(0,1fr));max-width:440px;margin:0 auto;background:#fff;border:3px solid #111;border-radius:6px;touch-action:none}
.kg-mc{aspect-ratio:1;display:grid;place-items:center;font-size:clamp(10px,3.4vw,20px);line-height:1;min-width:0}
.kg-mc.wt{border-top:2px solid #111}.kg-mc.wr{border-right:2px solid #111}.kg-mc.wb{border-bottom:2px solid #111}.kg-mc.wl{border-left:2px solid #111}
.kg-mc.tr{background:#EAF7FF}.kg-mc.hp{background:#FFE14D}
.kg-arrows{display:grid;grid-template-columns:repeat(3,64px);gap:8px;justify-content:center;margin-top:12px}
.kg-arrows .btn{min-height:56px;padding:0;font-size:22px}
/* simon */
.kg-simon{display:grid;grid-template-columns:1fr 1fr;gap:12px;max-width:340px;margin:10px auto}
.kg-simon .kg-pad{display:block;aspect-ratio:1;border:var(--bd);border-radius:24px;background:var(--p);opacity:.55;box-shadow:4px 4px 0 #111;margin:0}
.kg-simon .kg-pad.lit{opacity:1;filter:brightness(1.25);transform:scale(1.04)}
/* reaction */
.kg-react{width:100%;min-height:260px;border:var(--bd);border-radius:24px;font-size:28px;font-weight:800;box-shadow:var(--hs);touch-action:manipulation}
.kg-react.wait{background:#FF8A8A}.kg-react.go{background:#C6FF3D}.kg-react.early{background:#FFE14D}.kg-react.done{background:#6FD3FF}

/* ---------- offline play page ---------- */
.ge-play #app{padding-bottom:40px}

/* ---------- larger screens ---------- */
@media (min-width:700px){
 .gel-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .gel-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
 .gel-badges{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:360px){
 .gel-word{font-size:32px!important}
 .kg-pad{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media (prefers-reduced-motion:reduce){
 .gel-spin{animation-duration:2s}
 .kg-ok,.kg-no{animation:none}
 .kg-simon .kg-pad.lit{transform:none}
 .gel-tile,.kg-card{transition:none}
}
@media (forced-colors:active){
 .kg-cell.sel,.kg-l.sel,.kg-mc.hp,.kg-simon .kg-pad.lit{outline:3px solid Highlight}
}
/* inline emphasis inside learning text (the app styles .card b as a block heading) */
#app .gel-q p b,#app .gel-good b,#app .gel-bad b,#app .gel-tech p>b,#app .gel-wordcard p>b,#app .gel-news p>b,#app .gel-report p>b,#app .gel-q .muted b,#app .card .note b,#app .gel-blank b{display:inline;font-size:inherit}
/* Non-zero letter-spacing turns off ligatures/conjunct shaping for Indic and Arabic scripts in Chromium. */
html:not([lang^="en"]) h1,html:not([lang^="en"]) h2,html:not([lang^="en"]) b,html:not([lang^="en"]) .btn,html:not([lang^="en"]) .chip,html:not([lang^="en"]) .pill,html:not([lang^="en"]) #nav button{letter-spacing:0!important}
[lang]:not([lang^="en"]):not(html){letter-spacing:0}
.top>.chip,.kg-head>.chip{flex:none;white-space:nowrap}

/* ---------- two-tone icons (same .ico style as the rest of the app: accent fill + ink outline) ---------- */
#app .btn .ico,#app .chip .ico,.kg-root .chip .ico{display:inline-block;width:22px;height:22px;margin-right:8px;flex:none}
#app .btn .ico:only-child{margin:0;width:26px;height:26px}
.gel-wbtn .btn{gap:4px}.gel-wbtn .btn .ico{margin:0}.gel-wbtn small{font-size:11px;color:#111}
.gel-pill .ico{display:inline-block;width:14px;height:14px;vertical-align:-2px;margin-right:4px}
.gel-pill .ico .s,.kg-best .ico .s{stroke-width:2.4}
.gel-tile>span .ico{width:36px;height:36px}
.gel-tile>.ico{width:28px;height:28px}
.gel-tasks .gel-ic .ico{width:28px;height:28px}
.gel-mini>span:first-child .ico{width:32px;height:32px}
.kg-burst .ico{width:76px;height:76px;margin:0 auto}
.gel-days span .ico{width:24px;height:24px}
.gel-badge>span .ico{width:32px;height:32px}
.card details summary .ico{display:inline-block;width:20px;height:20px;vertical-align:-5px;margin-right:6px}
.gel-iline,.kg-hintline{display:flex;align-items:center;gap:8px}
.gel-iline .ico,.kg-hintline .ico{width:22px;height:22px;flex:none}
.kg-head h1{display:flex;align-items:center;gap:8px}
.kg-head h1 .ico{width:32px;height:32px;flex:none}
.kg-best .ico{display:inline-block;width:22px;height:22px;vertical-align:-5px}
/* game pieces */
.kg-card .ico{width:64%;height:64%}
.kg-f .ico{width:74%;height:74%;margin:auto}
.kg-f{display:grid;place-items:center}
.kg-mc .ico{width:88%;height:88%}
.kg-seq{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;align-items:center;margin:6px 0}
.kg-it{display:inline-flex;gap:2px;align-items:center;padding:4px;border:2px solid #111;border-radius:10px;background:#fff}
.kg-it .ico{width:34px;height:34px}
.kg-num{font-weight:800;font-size:24px;padding:0 4px}
.kg-opts4 .btn.kg-pic{display:flex;flex-wrap:wrap;gap:2px;justify-content:center}
.kg-opts4 .kg-pic .ico{width:42px;height:42px;margin:0}
.kg-arrows .ico{width:26px;height:26px;margin:0}
.kg-findrow{display:flex;align-items:center;justify-content:center;gap:10px}
.kg-target .ico{width:46px;height:46px}
.kg-pad .btn .ico{margin:0}
.ge-play .top h1 .ico{width:36px;height:36px}
#app .kg-opts4 .kg-pic .ico{width:44px;height:44px;margin:0}
#app .kg-pad .btn .ico{width:26px;height:26px;margin:0}
#app .kg-arrows .btn .ico{width:26px;height:26px;margin:0}
#app .gel-tile>span .ico{width:40px;height:40px}
#app .gel-tile>.ico{width:28px;height:28px;margin:0}
#app .gel-wbtn .btn .ico{width:24px;height:24px;margin:0}
#app .note .ico{display:inline-block;width:18px;height:18px;vertical-align:-4px;margin-right:6px}

/* ---------- v4: Make & Create and AI Explained ---------- */
.ged-pills{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
.ged-pills .gel-pill svg{width:14px;height:14px;margin-inline-end:4px;vertical-align:-2px}
.ged-note,.ged-aihelp,.ged-sup{border-inline-start:4px solid #B79CFF}
.ged-sup-required{border-inline-start-color:#FF5CAA}
.ged-sup-nearby{border-inline-start-color:#FFB36B}
.ged-sup-none{border-inline-start-color:#7CF2B2}
.ged-note b,.ged-sup b{display:flex;align-items:center;gap:8px}
.ged-note svg,.ged-sup svg{width:20px;height:20px}
.ged-find textarea,.ged-done textarea{width:100%;box-sizing:border-box;margin:8px 0;padding:10px 12px;border-radius:14px;font:inherit;min-height:64px}
.ged-res small,.ged-miss,.ged-have{display:block}
.ged-miss{opacity:.85}
.ged-have{color:#2f8f5b}
.ged-list{margin:6px 0 0;padding-inline-start:20px}
.ged-list li{margin:4px 0}
.ged-check,.ged-steps{list-style:none;margin:0;padding:0}
.ged-steps{counter-reset:ged}
.ged-check li,.ged-steps li{display:flex;gap:12px;align-items:flex-start;padding:10px 0;border-bottom:1px solid rgba(128,128,160,.2)}
.ged-steps li{counter-increment:ged}
.ged-steps li span::before{content:counter(ged) ". ";font-weight:700}
.ged-steps li.done span{opacity:.6}
.ged-box{flex:0 0 auto;width:34px;height:34px;min-width:34px;border-radius:10px;border:2px solid #8a85c9;background:transparent;display:inline-flex;align-items:center;justify-content:center;padding:0;cursor:pointer}
.ged-box.on{background:#C6FF3D;border-color:#C6FF3D}
.ged-box svg{width:20px;height:20px}
.ged-box:disabled{opacity:.5;cursor:default}
.ged-prompt{margin:10px 0;padding:10px 12px;border-radius:14px;background:rgba(128,128,200,.12)}
.ged-ptext{white-space:pre-wrap;word-break:break-word;margin:6px 0}
@media (max-width:420px){.ged-box{width:38px;height:38px}}
@media (prefers-reduced-motion:reduce){.ged-box{transition:none}}
