/* Illustrated game boards. The original interactive elements remain in document order. */
.modal-box:has(.ar-round) {
  width:min(1100px,100%); max-height:calc(100dvh - 22px); padding:0;
  border:0; border-radius:clamp(16px,2vw,30px); overflow:auto; background:#b9e8fb;
}
.modal-box:has(.ar-round) .modal-x {
  inset:12px 12px auto auto; z-index:6; width:46px; height:46px;
  color:#101e4b; background:#fff; border:2px solid #fff; box-shadow:0 3px 0 #bac9df,0 5px 13px #23375a55;
}
body:has(.modal:not([hidden]) .ar-round) :is(#roboFab,#roboPeek),
body:has(.modal:not([hidden]) :is(.cr,.tr)) :is(#roboFab,#roboPeek) {visibility:hidden}
.ar-round {
  --scene:url('./arcade-robotics.webp'); --trim:#a9632b; --base:#b2d8f2;
  position:relative; display:flow-root; padding:0 0 clamp(20px,4vw,50px);
  background:var(--base) var(--scene) center top / 100% 100% no-repeat;
  color:#182650; font-family:'Nunito',sans-serif;
}
.ar-round[data-theme="language"] {--scene:url('./arcade-language.webp');--trim:#ae6b37;--base:#d9e9bd}
.ar-round[data-theme="math"] {--scene:url('./arcade-math.webp');--trim:#ad6f26;--base:#b2e2fb}
.ar-round[data-theme="creative"] {--scene:url('./arcade-creative.webp');--trim:#ad673c;--base:#bfead9}
.ar-round .gtop {
  margin:0; padding:clamp(18px,3vw,30px) max(16%,60px) clamp(13px,1.8vw,19px);
  min-height:clamp(96px,14vw,145px); align-items:center; justify-content:center; text-align:center;
}
.ar-round .gtop>div{min-width:0;width:100%}
.ar-round .gtop h2,.cr .cr-head h2,.tr .ar-teach-title {
  display:table; max-width:100%; width:fit-content; margin:0 auto; padding:.17em .55em .22em;
  color:#fff9dd; border:2px solid #986021; border-radius:25% 18% 16% 18% / 75% 58% 66% 68%;
  background:linear-gradient(180deg,#fdbd59,#d88938 52%,#c3732e 56%,#cc8537);
  box-shadow:inset 0 3px 1px #ffd27b,inset 0 -4px 0 #a96326,0 3px 0 #8a4c21,0 5px 9px #493d4245;
  font:700 clamp(1.6rem,3.2vw,2.8rem)/1.06 'Fredoka',sans-serif;
  -webkit-text-stroke:2px #53341b; paint-order:stroke fill;
  text-shadow:0 2px #674117,0 3px #815329; text-wrap:balance;
}
.ar-round .gtop>div>div,.cr .cr-ht p {
  width:fit-content; max-width:100%; margin:6px auto 0; padding:4px 13px;
  background:#fff5d9f5; border-radius:13px; border:1px solid #ddae68;
  color:#453119!important; font:750 clamp(.84rem,1.3vw,1.08rem)/1.25 'Nunito',sans-serif;
}
.ar-play,.ar-finish .result{
  width:min(73%,800px); margin:0 auto; padding:clamp(15px,2.4vw,29px);
  border:clamp(4px,.52vw,7px) solid var(--trim); border-radius:clamp(19px,2.5vw,30px);
  background:linear-gradient(140deg,#fff9e5,#fff3d4 65%,#ffe9bd);
  box-shadow:inset 0 0 0 2px #fff9df,0 0 0 2px #8a552b,0 9px 18px #29233644;
}
.ar-play>*{min-width:0}
.ar-play .qcard {
  padding:clamp(12px,2vw,20px) 5px; text-align:center; background:transparent; border:0;
}
.ar-play .qcard .qt,.ar-play .qcard .sayphrase {
  color:#152650; font:650 clamp(1.15rem,2.05vw,1.65rem)/1.25 'Fredoka',sans-serif; text-wrap:balance;
}
.ar-play .qcard .big{font-size:clamp(2.8rem,5.4vw,4.5rem);line-height:1.08}
.ar-play .qcard .big svg{max-width:100%;height:auto}
.ar-play .gprog {
  align-items:center; gap:clamp(7px,1.6vw,20px); margin:0 0 4px;
  padding:9px 15px; color:#172c55; background:#fff; border-radius:22px;
  font:650 clamp(.83rem,1.3vw,1.1rem)/1.16 'Fredoka',sans-serif;
  box-shadow:0 2px 0 #d2bd97,0 4px 7px #5b41231f;
}
.ar-play .gprog>span:first-child,.ar-play .gprog>span:last-child{flex:0 0 auto}
.ar-play .ar-steps {display:flex; align-items:center; flex:1; gap:4px; min-width:1px}
.ar-play .ar-steps i {min-width:0; height:10px; flex:1; background:#b7dcf9; border-radius:10px}
.ar-play .ar-steps i.done{background:#138553}.ar-play .ar-steps i.current{background:#fff;box-shadow:inset 0 0 0 2px #2365df}
.ar-play .gprog:has(.ar-steps)+.bar{display:none}
.ar-play .choices {gap:10px; margin-top:10px; grid-template-columns:repeat(2,minmax(0,1fr))}
.ar-play .choices.three {grid-template-columns:repeat(3,minmax(0,1fr))}
.ar-play .choices.fr-pics.six {grid-template-columns:repeat(3,minmax(0,1fr))}
.ar-play .choices:not(.three):not(.fr-pics)>:last-child:nth-child(odd) {grid-column:1 / -1}
.ar-play .choices .choice {
  --top:#ee2d75; --bottom:#bc0649;
  min-height:52px; min-width:0; padding:10px 15px;
  color:white; text-align:center; overflow-wrap:anywhere; border:3px solid #fff;
  border-radius:28px; background:linear-gradient(180deg,var(--top),var(--bottom));
  box-shadow:inset 0 2px 1px #ffffff6b,inset 0 -4px 1px #0002,0 3px 0 #bb9870,0 6px 10px #51371935;
  font:650 clamp(1rem,1.66vw,1.3rem)/1.18 'Fredoka',sans-serif; text-shadow:0 1px 2px #27314560;
}
.ar-play .choice:nth-child(6n+2){--top:#278ef4;--bottom:#104cba}
.ar-play .choice:nth-child(6n+3){--top:#ffd856;--bottom:#ed9d0e;color:#422605;text-shadow:0 1px #ffebad}
.ar-play .choice:nth-child(6n+4){--top:#239165;--bottom:#126239}
.ar-play .choice:nth-child(6n+5){--top:#8b5acd;--bottom:#63339a}
.ar-play .choice:nth-child(6n){--top:#187d94;--bottom:#08536d}
.ar-play .choice b{color:inherit!important}
.ar-play .choice:hover:not(:disabled){filter:brightness(1.07);border-color:#fff}
.ar-play .choice.right{color:#134523;text-shadow:none;outline:2px solid #14813d;outline-offset:0}
.ar-play .choice.wrong{color:#70223a;text-shadow:none;outline:2px dashed #b52846;outline-offset:0}
.ar-play .choice.right::after{content:" ✓"}.ar-play .choice.wrong::after{content:" ×"}
.ar-play :is(.btn,summary):focus-visible,.ar-play .choice:focus-visible{outline:3px solid #163c8b;outline-offset:3px}
.ar-play .feedback {border:1px solid #ddbd86;background:#fffaf0;color:#243651}
.ar-play .feedback img {width:clamp(40px,5vw,60px)}
.ar-play .feedback .btn,.ar-play .gnext .btn,.ar-round .result .btn {min-height:44px}
.ar-play .spell-form .field {min-width:0}.ar-play .spell-slots{flex-wrap:wrap}
.ar-finish{display:grid;place-items:center;min-height:clamp(260px,40vw,490px);padding:clamp(35px,5vw,65px) 0}
.ar-finish .result{width:min(66%,640px)}.ar-finish .result>img{width:clamp(66px,8vw,108px)}
.ar-play:has(.draw-wrap){width:94%}
.ar-play .readbox,.ar-play .readmini {background:#fffdf5;border-color:#d5b88a}
.ar-play .readmini summary{padding:8px 2px;min-height:44px}
.ar-play .readbox{overflow-wrap:anywhere}
.cr .cr-head {
  min-height:154px;padding:23px 16% 38px;text-align:center;
  background:#bde2f8 url('./arcade-robotics.webp') center 44% / cover no-repeat;
}
.cr .cr-head::before,.cr .cr-hrobo,.cr .cr-isl{display:none}
.cr .cr-ht {position:relative;inset:auto;margin:0 auto;width:100%;max-width:680px}
.cr .cr-main{margin-top:-12px}
.cr .cr-bwrap,.cr .cr-side,.tr .tr-panel{background:#fff7df;border:4px solid #cc924e;box-shadow:inset 0 0 0 2px #fff9e9,0 5px 13px #57402733}
.tr .tr-head {
  display:grid;grid-template-columns:1fr 1fr;align-items:center;justify-content:center;gap:5px 9px;
  aspect-ratio:auto;padding:18px 15% 20px;text-align:center;
  background:#bef3cb url('./arcade-robotics.webp') center 46% / cover no-repeat;
}
.tr .ar-teach-title {grid-column:1/-1}
.tr .tr-step,.tr .tr-note {
  position:static;width:auto;height:auto;transform:none;margin:0;padding:6px 9px;
  color:#433017;background:#fff7deed;border-radius:12px;border:1px solid #ddb87e;
  font:700 clamp(.8rem,1.12vw,.95rem)/1.24 'Nunito',sans-serif;
}
.tr .tr-step{grid-column:1/-1;display:block;justify-self:center;font-size:clamp(.94rem,1.48vw,1.14rem)}
.tr .tr-foot{min-width:0}
@media(max-width:700px) {
  .modal-box:has(.ar-round){max-height:calc(100dvh - 16px);border-radius:18px}
  .modal-box:has(.ar-round) .modal-x{width:44px;height:44px;inset:6px 6px auto auto}
  .ar-round {padding:0 0 8px;background-size:100% auto}
  .ar-round .gtop {min-height:110px; padding:14px 15% 15px; background:var(--scene) center 48% / cover no-repeat}
  .ar-round .gtop h2,.cr .cr-head h2,.tr .ar-teach-title{font-size:clamp(1.4rem,5.3vw,1.9rem)}
  .ar-play,.ar-finish .result{width:96%;padding:14px 12px;border-width:4px}
  .ar-play .choices,.ar-play .choices.three{grid-template-columns:1fr;gap:8px}
  .ar-play .choices.fr-pics,.ar-play .choices.fr-pics.six,.ar-play .choices.four {grid-template-columns:repeat(2,minmax(0,1fr))}
  .ar-play .choices.fr-pics .choice {min-height:55px}
  .ar-play .choices .choice{min-height:46px;font-size:1.04rem;line-height:1.2}
  .ar-play .gprog{font-size:.83rem;gap:7px;padding:8px 10px}
  .ar-play .ar-steps{gap:2px}.ar-play .ar-steps i{height:8px}
  .ar-play .qcard{padding:12px 4px}.ar-play .qcard .big{font-size:2.9rem}
  .ar-play .qcard .qt,.ar-play .qcard .sayphrase{font-size:clamp(1.07rem,4.8vw,1.36rem)}
  .ar-play:has(.draw-wrap){width:98%}
  .ar-finish{padding:52px 0 12px;background-position:top}
  .cr .cr-head,.tr .tr-head{padding:14px 54px 17px;min-height:0}
  .tr .tr-head{padding-inline:10px}.tr .ar-teach-title{max-width:calc(100% - 100px)}
  .tr .tr-note{font-size:.82rem}.cr .cr-main{margin-top:0}
}
@media(max-width:380px){
  .ar-round .gtop{padding-left:12px;padding-right:53px}
  .ar-play .gprog{flex-wrap:wrap}.ar-play .ar-steps{min-width:28px}
  .ar-play .qcard .saybtns,.ar-play .spell-form {flex-wrap:wrap}
  .tr .tr-head{grid-template-columns:1fr;padding-top:11px}
  .tr .tr-note{max-width:100%}
}
@media(prefers-reduced-motion:reduce){.ar-round *{animation-duration:0s!important;transition-duration:0s!important}}
