/* Science and technology share the lesson player, including its topic lesson packs. */
.tc-lesson {
  --academy-scene: url("academy-technology.webp");
  --academy-strip: url("game-sky-tech.webp");
}
.tc-lesson.sc-lesson, .tc-lesson:has(.tc-back[href^="#science/"]) {
  --academy-scene: url("academy-science.webp");
  --academy-strip: url("game-sky-science.webp");
}
.tc-lesson, .typ.tyg, .typ.ty3 {
  --academy-paper: linear-gradient(125deg,#fffdf4,#fff8e6 62%,#ffefc5);
  --academy-gold: #c48a43;
  --academy-ink: #132952;
  --academy-edge: inset 0 2px #fff7d2, 0 4px 0 #925729, 0 9px 19px #46382026;
}
.tc-lesson .tc-ltop, .typ.tyg .ty-ltop {
  background:linear-gradient(90deg,#fff8 0%,#fff1 55%,transparent),var(--academy-strip,url("game-sky-typing.webp")) center 54%/cover,#b8e8ef;
  border:2px solid #fff; box-shadow:0 3px 0 #547e92,0 8px 16px #23466722;
  border-radius:20px; padding:9px clamp(8px,1.5vw,20px);
}
.tc-lesson .tc-lprog {
  background:#fffdf5f7; color:var(--academy-ink); padding:8px 12px; border:1px solid #e3c89d; border-radius:14px;
}
.tc-lesson .tc-lprog b {white-space:normal; overflow:visible; line-height:1.15; overflow-wrap:anywhere}
.tc-lesson .tc-lprog .tc-lpbar {background:#b7dcf1}
.tc-lesson #tcStage {min-width:0}
.tc-lesson #tcStage > :is(.tc-quiz,.tc-scen,.tc-match,.tc-build,.tc-find,.tc-sort,.tc-order,.tc-ex,.tc-done) {
  min-width:0; box-sizing:border-box; padding:clamp(10px,1.65vw,24px);
  border:clamp(3px,.45vw,6px) solid var(--academy-gold); border-radius:clamp(17px,2vw,30px);
  box-shadow:var(--academy-edge); background:var(--academy-paper); color:var(--academy-ink);
}
.tc-lesson :is(.tc-ahead,.tc-q2n) {
  background:#fffdf7; color:#17335a; border:1px solid #d8bc8a; border-radius:99px;
  box-shadow:0 2px 0 #d9bd92; font-family:"Fredoka",var(--head);
}
.tc-lesson .tc-ahead {padding:7px 12px; width:fit-content; max-width:100%; flex-wrap:wrap}
.tc-lesson .tc-qdots i:not(.on):not(.cur) {background:#b5d8f2}
.tc-lesson .tc-quiz2 .tc-q2h,
.tc-lesson .tc-quiz:not(.tc-quiz2) .tc-qbox.q > .tc-bubble {
  position:relative; isolation:isolate; box-sizing:border-box;
  background:#fff6dd;
  border:2px solid #daad68; border-radius:18px; padding:clamp(13px,1.6vw,22px);
  box-shadow:inset 0 2px #fffdf3,0 3px 0 #cda375;
}
.tc-lesson .tc-quiz2 .tc-q2h::after,
.tc-lesson .tc-quiz:not(.tc-quiz2) .tc-qbox.q > .tc-bubble::after {
  content:""; pointer-events:none; position:absolute; z-index:-1; inset:0 0 0 auto; width:31%; border-radius:0 16px 16px 0;
  background:linear-gradient(90deg,#fff6dd,transparent 34%),var(--academy-scene) 86% 43%/cover no-repeat;
}
.tc-lesson .tc-quiz2 .tc-q2h {
  display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"count voice" "question question" "hint hint";
  align-items:start; gap:9px; margin:0; padding-right:31%; min-height:160px;
}
.tc-lesson .tc-quiz2 .tc-q2n {grid-area:count; justify-self:start; position:static; padding:6px 12px; font-size:1rem}
.tc-lesson .tc-quiz2 .tc-q2t {
  grid-area:question; max-width:none; min-width:0; margin:0; padding:0; color:var(--academy-ink);
  font:650 clamp(21px,2.1vw,34px)/1.16 "Fredoka",var(--head); overflow-wrap:anywhere;
}
.tc-lesson .tc-quiz2 .tc-q2hint {grid-area:hint; justify-self:start; background:#fffdf4; border:1px solid #e9d69a; border-radius:14px; min-width:0}
.tc-lesson .tc-quiz2 .tc-q2spk {grid-area:voice; position:static; width:44px; height:44px; justify-self:end}
.tc-lesson .tc-quiz2 .tc-q2r {display:none}
.tc-lesson .tc-quiz:not(.tc-quiz2) .tc-qbox.q > .tc-bubble {
  position:relative; inset:auto; display:flex; align-items:center; padding-right:31%; min-height:130px; margin:0;
}
.tc-lesson .tc-quiz:not(.tc-quiz2) .tc-qbox.q > .tc-bubble p {min-width:0; flex:1; overflow-wrap:anywhere}
.tc-lesson .tc-stage .tc-spk {min-width:44px; min-height:44px}
.tc-lesson :is(.tc-q2opts,.tc-qopts,.tc-sopts) > button {
  --answer-top:#eb3185; --answer-base:#ab0a56; --answer-text:#fff;
  min-width:0; border:3px solid #fff8eb; border-radius:18px; color:#162d54;
  background:linear-gradient(145deg,#fffdf6,#edf5ff); box-shadow:0 0 0 1px #dbbc87,0 4px 0 #b3956e,0 8px 13px #70542922;
}
.tc-lesson :is(.tc-q2opts,.tc-qopts,.tc-sopts)>button:nth-child(3n + 2) {--answer-top:#207edc; --answer-base:#154cb1}
.tc-lesson :is(.tc-q2opts,.tc-qopts,.tc-sopts)>button:nth-child(3n) {--answer-top:#ffd761; --answer-base:#f3ae25;--answer-text:#40280c}
.tc-lesson :is(.tc-q2opts,.tc-qopts,.tc-sopts)>button:is(.ok,.bad) {
  box-shadow:0 0 0 3px var(--answer-base),0 5px 9px #513b162b;
}
.tc-lesson :is(.tc-q2opts,.tc-qopts,.tc-sopts)>button.ok {--answer-top:#2a9763;--answer-base:#10613d;--answer-text:#fff}
.tc-lesson :is(.tc-q2opts,.tc-qopts,.tc-sopts)>button.bad {--answer-top:#b83554;--answer-base:#87203b;--answer-text:#fff}
.tc-lesson :is(.tc-q2opts,.tc-qopts,.tc-sopts) > button > b {
  display:block; align-self:stretch; min-width:0; margin:0; padding:8px clamp(7px,1vw,14px);
  border:2px solid white; border-radius:15px; background:linear-gradient(var(--answer-top),var(--answer-base));
  box-shadow:inset 0 2px #ffffff60,0 2px 0 #78604255; color:var(--answer-text);
  text-align:center; overflow-wrap:anywhere; font:650 clamp(16px,1.5vw,22px)/1.22 "Fredoka",var(--head);
}
.tc-lesson .tc-sopts>button > b {flex:1}
.tc-lesson :is(.tc-quiz,.tc-scen) .tc-qfb:not(:empty) {border-radius:16px}
.tc-lesson :is(.tc-stage,.tc-ltop) :focus-visible,.typ.tyg :focus-visible {outline:3px solid #12478a; outline-offset:2px}
.tc-lesson .tc-stage :is(.tc-btn,.tc-spk), .typ.tyg :is(.ty-cont,.ty-cb) {min-height:44px}
.tc-lesson :is(.tc-sbox,.tc-mgrid,.tc-buildboard,.tc-bins2) {outline:2px solid #e3be82; outline-offset:0}
.tc-lesson .tc-done {border-color:#b67c34}

/* The real typing inputs, target strings, highlight keys and moving game objects remain independent. */
.typ.tyg {
  --academy-strip:url("game-sky-typing.webp"); --typing-scene:url("academy-typing.webp");
  --typing-board:url("typing-falling.webp");
}
.typ.tyg:has(.tg-builder) {--typing-board:url("typing-builder.webp")}
.typ.tyg:has(.tg-race) {--typing-board:url("typing-race.webp")}
.typ.tyg:has(.tg-treasure) {--typing-board:url("academy-treasure.webp")}
.typ.tyg:has(.tg-rocket) {--typing-board:url("typing-rocket.webp")}
.typ.tyg .ty-ltop {align-items:center; gap:10px; flex-wrap:wrap}
.typ.tyg .ty-diff {max-width:100%; flex-wrap:wrap}
.typ.tyg .ty-diff button {min-height:44px}
.typ.tyg .tg-head {
  display:grid;grid-template-columns:minmax(0,1fr) minmax(210px,32%); grid-template-rows:auto auto; gap:12px 16px;
  background:linear-gradient(90deg,#fff7dd 55%,#fff7dddf 65%,transparent 83%),
             var(--typing-scene) right 35%/max(44%,290px) auto no-repeat,#fff7dd;
  padding:clamp(12px,1.6vw,24px);border:3px solid var(--academy-gold);border-radius:22px;box-shadow:var(--academy-edge);
}
.typ.tyg .tg-head > img {display:none}
.typ.tyg .tg-head > div:first-of-type {grid-column:1; min-width:0;color:#14254c}
.typ.tyg .tg-head h1 {
  display:inline-block;margin:0; padding:6px 17px 9px; border:2px solid #965325; border-radius:13px;
  background:linear-gradient(178deg,#ffe195,#f2b057 46%,#e8a245 50%,#ffc267);
  box-shadow:inset 0 2px #fff0b7,inset 0 -3px #ad6d2c,0 3px 0 #87532d;
  color:#442711;font:650 clamp(23px,2.3vw,37px)/1.08 "Fredoka",var(--head);overflow-wrap:anywhere;
}
.typ.tyg .tg-head p {margin:8px 0 0;line-height:1.4}
.typ.tyg .tg-head .ty-chips {grid-column:1;margin:0;grid-template-columns:repeat(3,minmax(0,1fr));width:min(450px,100%)}
.typ.tyg .tg-head .ty-chips > div {min-width:0;background:#fffdf6f5;border:1px solid #d6bb87}
.typ.tyg .ty-focus, .typ.ty3 .ty-stage {
  box-sizing:border-box;min-width:0;padding:clamp(8px,1.2vw,16px);
  background:var(--academy-paper);border:clamp(3px,.4vw,6px) solid var(--academy-gold);border-radius:22px;box-shadow:var(--academy-edge);
}
.typ.tyg .ty-focus:has(>.tg-over:not([hidden])) > :is(.tg-arena,.ty-target) {display:none}
.typ.tyg .tg-over:not([hidden]) {
  position:relative;inset:auto;display:grid;place-items:center;
  background:linear-gradient(90deg,#fff3dce8 0%,#fff2dfbf 44%,#fff0 73%),var(--typing-board) center/cover,#fff6e4;
  border:1px solid #b38b51;border-radius:15px; min-height:clamp(190px,28vw,330px);padding:clamp(10px,2vw,28px);
}
.typ.tyg .tg-over>div {box-sizing:border-box;justify-self:start;max-width:min(53%,430px);
  gap:8px;padding:12px clamp(9px,1.2vw,18px);border-radius:16px;background:#fffaf0f7;border:1px solid #d2b378;box-shadow:0 4px 12px #62431933}
.typ.tyg .tg-over>div>img {display:none}
.typ.tyg .tg-over:has(#tgAgain) {background-image:linear-gradient(90deg,#fff3dce8 0%,#fff2dfbf 44%,#fff0 73%),url("academy-treasure.webp")}
.typ.tyg .tg-over h2 {font-size:clamp(18px,1.8vw,28px);line-height:1.12;overflow-wrap:anywhere}
.typ.tyg .tg-over p,.typ.tyg .tg-over small {margin:0;overflow-wrap:anywhere;line-height:1.34}
.typ.tyg .tg-over .ty-cont {width:auto;justify-self:center;min-width:110px;max-width:100%;background:linear-gradient(#2778bd,#144b9e);color:white;
  border:2px solid white;border-radius:999px;box-shadow:inset 0 2px #ffffff4d,0 3px 0 #143c7d}
.typ.tyg #tgArena {border:2px solid #e3c191;background-image:linear-gradient(#17274a7a,#17274a68),var(--typing-board);
  background-position:center;background-size:cover}
.typ.tyg #tgArena.tg-rocket {position:relative;inset:auto;transform:none;transition:none;font-size:inherit}
.typ.tyg #tgArena:is(.tg-builder,.tg-treasure) {background-image:linear-gradient(#fff7e6cc,#fff2d8b8),var(--typing-board)}
.typ.tyg #tgArena.tg-race {background-image:linear-gradient(#eefbff99,#d5efc580),var(--typing-board)}
.typ.tyg .tg-build > img {max-width:19%;height:auto;max-height:48%;object-fit:contain}
.typ.tyg .tg-build > small,.typ.tyg .tg-chest > div {color:#18264f;background:#fffaf0ed;border-radius:12px;padding:3px 9px}
.typ.tyg .tg-slots {max-width:92%;min-width:0;gap:clamp(2px,.7vw,8px)}
.typ.tyg .tg-slots span {min-width:0;max-width:8vw;height:clamp(32px,5vw,56px);font-size:clamp(17px,2.2vw,29px)}
.typ.tyg :is(.ty-kb,.tg-arena,.ty-target) {min-width:0}
@media(max-width:700px){
  .tc-lesson .tc-quiz2 .tc-q2h {min-height:116px; gap:7px; padding:12px 25% 12px 10px}
  .tc-lesson .tc-quiz2 .tc-q2h::after,.tc-lesson .tc-quiz:not(.tc-quiz2) .tc-qbox.q > .tc-bubble::after {width:24%}
  .tc-lesson .tc-quiz:not(.tc-quiz2) .tc-qbox.q > .tc-bubble {min-height:98px; padding:10px 24% 10px 8px; gap:6px}
  .tc-lesson .tc-quiz2 .tc-q2n {font-size:.88rem; padding:5px 9px}
  .tc-lesson .tc-quiz2 .tc-q2o:not(:has(.tc-q2p)) {display:block;min-height:48px}
  .tc-lesson .tc-q2opts {gap:10px}
  .tc-lesson :is(.tc-qo,.tc-so,.tc-q2o) {min-height:48px}
  .typ.tyg .tg-head {grid-template-columns:minmax(0,1fr) 22%;gap:9px 4px;background-size:100% 100%,54% auto;background-position:center,right top}
  .typ.tyg .tg-head .ty-chips {grid-column:1/-1}
  .typ.tyg .tg-over > div {max-width:min(77%,430px)}
  .typ.tyg .tg-build > img {display:none}
}
@media(max-width:410px){
  .tc-lesson .tc-quiz2 .tc-q2h {padding-right:12px}
  .tc-lesson .tc-quiz2 .tc-q2h::after {display:none}
  .typ.tyg .ty-diff button{padding-inline:8px}
  .typ.tyg .tg-over > div {max-width:86%}
}
