/* Scope every learning control to these two games; existing games retain their styles. */
html body #gameEngine #gameContent#gameContent:is([data-reef-game="origins-insertions"],[data-reef-game="kinesiology-quest"]){--am-paper:#fffaf0;--am-panel:#e4f4f5;--am-ink:#153850;--am-edge:#89b5bf;--am-muted:#365d71}
html.dark body #gameEngine #gameContent#gameContent:is([data-reef-game="origins-insertions"],[data-reef-game="kinesiology-quest"]){--am-paper:#11263b;--am-panel:#203d53;--am-ink:#f0f8ff;--am-edge:#6299ad;--am-muted:#c5dae8}
html body #gameEngine #gameContent#gameContent:is([data-reef-game="origins-insertions"],[data-reef-game="kinesiology-quest"]) .ugc-stage{background:var(--am-paper)!important;border-color:var(--am-edge)!important;padding:clamp(12px,2vw,24px);min-width:0}
html body #gameEngine #gameContent#gameContent .am-game{color:var(--am-ink);font-size:17px;line-height:1.55;min-width:0}
html body #gameEngine #gameContent#gameContent .am-game :is(h2,h3,h4,p,label,small,strong,span,figcaption,a){color:var(--am-ink)!important;opacity:1!important}
html body #gameEngine #gameContent#gameContent .am-game h2{font-size:clamp(23px,2.2vw,32px);font-weight:900;line-height:1.3;margin:10px 0 20px}
html body #gameEngine #gameContent#gameContent .am-game h3{font-size:21px;font-weight:800;margin:12px 0}
.am-game p{margin:10px 0}.am-game :is(button,select,input){font:inherit}.am-game :is(button,select){min-height:48px}.am-game button{cursor:pointer}.am-game button:disabled{cursor:default}
html body #gameEngine #gameContent#gameContent .am-game button{padding:12px 17px!important;border:2px solid #9feeff!important;border-radius:16px!important;box-shadow:inset 0 2px #ffffff99,0 4px #00294f88,0 8px 16px #001d4533!important;background:linear-gradient(#0b759b,#075a83)!important;color:#fff!important;font-weight:800;line-height:1.4;white-space:normal;text-align:center}
html body #gameEngine #gameContent#gameContent .am-game button :is(span,strong){color:inherit!important}
html body #gameEngine #gameContent#gameContent .am-game button.am-primary{background:linear-gradient(#ffe696,#ffbf4b)!important;color:#153850!important;border-color:#fff4c7!important;font-size:21px;display:block;max-width:100%;margin:20px auto;min-height:60px}
html body #gameEngine #gameContent#gameContent .am-game button:hover:not(:disabled){filter:brightness(1.1)}
html body #gameEngine #gameContent#gameContent .am-game :is(button,select,input,a):focus-visible{outline:4px solid #f05aa8!important;outline-offset:4px}
.am-game :is(button,[tabindex]){scroll-margin-top:130px}
html body #gameEngine #gameContent#gameContent .am-game .am-review{font-size:14px;background:var(--am-panel)!important;border:1px solid var(--am-edge);border-radius:12px;padding:10px 12px}
.am-selects{display:grid;gap:16px;margin:24px 0}.am-selects label{display:grid;gap:7px;font-weight:800}
html body #gameEngine #gameContent#gameContent .am-game select{background:var(--am-panel)!important;color:var(--am-ink)!important;border:2px solid var(--am-edge);border-radius:12px;padding:10px;max-width:100%;width:100%}
html body #gameEngine #gameContent#gameContent .am-game .am-eyebrow{font-size:14px;letter-spacing:.06em;text-transform:uppercase;font-weight:800;color:var(--am-muted)!important}
.am-stats{display:flex;gap:12px;flex-wrap:wrap;align-items:center;justify-content:space-between;font-weight:800}.am-stats button{margin-left:auto}
.am-game progress{width:100%;height:15px;accent-color:#0a9a76;margin:18px 0}.am-play-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:20px}
.am-answers{display:grid;gap:14px;margin:22px 0}.am-answers button{display:flex;align-items:center;gap:14px;text-align:left!important;width:100%}
html body #gameEngine #gameContent#gameContent .am-game .am-answers button:nth-child(4n+2){background:linear-gradient(#158153,#096343)!important}
html body #gameEngine #gameContent#gameContent .am-game .am-answers button:nth-child(4n+3){background:linear-gradient(#b72a77,#8b205a)!important}
html body #gameEngine #gameContent#gameContent .am-game .am-answers button:nth-child(4n+4){background:linear-gradient(#8656bf,#633992)!important}
.am-answers button>span{flex-shrink:0;display:grid;place-items:center;width:34px;height:34px;border:2px solid #fff9;border-radius:50%}
html body #gameEngine #gameContent#gameContent .am-game .am-answers button:disabled{opacity:1!important}
html body #gameEngine #gameContent#gameContent .am-game .am-answers button.am-correct{background:#175a3c!important;border-color:#83efad!important}
html body #gameEngine #gameContent#gameContent .am-game .am-answers button.am-wrong{background:#902b43!important;border-color:#ffb7c4!important}
.am-feedback{border:3px solid var(--am-edge);border-radius:18px;background:var(--am-panel);padding:18px;margin-top:20px}.am-feedback.am-correct{border-color:#49b882}.am-feedback.am-wrong{border-color:#e27097}
html body #gameEngine #gameContent#gameContent .am-game .am-feedback a{text-decoration:underline;font-weight:800}.am-hint{padding:12px;border-left:5px solid #e49e31;background:var(--am-panel)}
.am-mastery{margin-top:30px;border-top:2px solid var(--am-edge);padding-top:20px}.am-mastery p{font-size:15px}.am-complete{text-align:center}.am-score{font-size:64px;font-weight:900}.am-stars{font-size:48px;color:#d68a00;text-shadow:0 1px #fff4ba}
#amStatus:not(:empty){padding:12px;border:2px solid #da6394;background:var(--am-panel);border-radius:12px}
.am-model{margin:0;min-width:0;background:#071b31;border:2px solid #5cbbd1;border-radius:22px;overflow:hidden}.am-model canvas{width:100%;height:auto;max-height:480px;object-fit:contain;display:block}
html body #gameEngine #gameContent#gameContent .am-game .am-model figcaption{color:#e4f8ff!important;padding:12px;font-size:13px}.am-model-controls{display:flex;flex-wrap:wrap;gap:12px;padding:12px}
html body #gameEngine #gameContent#gameContent .am-game .am-model-controls label{color:#e4f8ff!important;display:grid;width:100%;font-size:14px}.am-model-controls input{width:100%;accent-color:#f37cbe}.am-model-controls button{font-size:14px;flex:1}
.am-diagram{position:relative;max-width:440px;margin:24px auto 0;border:2px solid var(--am-edge);border-radius:20px;background:var(--am-panel);overflow:hidden}.am-diagram svg{width:100%;height:auto;display:block;color:var(--am-ink)}.am-diagram p{padding:12px;font-size:13px}
html body #gameEngine #gameContent#gameContent .am-game button.am-marker{position:absolute;width:44px;height:44px;min-height:44px;transform:translate(-50%,-50%);padding:0!important;border-radius:50%!important;font-size:16px;border:3px solid #fff!important;background:#b51e4a!important;box-shadow:0 0 0 3px #e75b8980,0 4px 7px #0005!important}
html body #gameEngine #gameContent#gameContent .am-game button.am-marker.insertion{background:#075eaf!important;box-shadow:0 0 0 3px #5ccfff80,0 4px 7px #0005!important}
html body #gameEngine #gameContent#gameContent .am-game button.am-label{background:linear-gradient(#a82179,#7f1c5c)!important;cursor:grab}
html body #gameEngine #gameContent#gameContent .am-game button.am-label[aria-pressed=true]{outline:4px solid #ee9cd0!important}
html body #gameEngine:has(.am-game){max-width:1540px}
html body #gameSelector .uw-game-grid button:is(#origins-insertions,#kinesiology-quest){aspect-ratio:1!important}
@media(min-width:1200px){.am-game .am-play-layout:has(.am-model){grid-template-columns:minmax(0,.9fr) minmax(0,1.15fr)}}
@media(max-width:700px){.am-game{font-size:16px}.am-model canvas{max-height:350px}.am-selects{gap:14px}.am-answers button{padding:14px 10px!important}.am-diagram{margin-top:16px}.am-stats{gap:8px;font-size:14px}.am-stats button{padding:8px!important}}
@media(prefers-reduced-motion:reduce){.am-game *{scroll-behavior:auto!important;transition:none!important}}

.am-diagram-picture{position:relative}

/* Full context art stays readable without introducing scored raster hotspots. */
html body #gameEngine #gameContent#gameContent .am-pictures{margin:0;padding:18px;background:var(--am-panel);color:var(--am-ink);border:2px solid var(--am-edge);border-radius:22px;min-width:0;align-self:start}
html body #gameEngine #gameContent#gameContent .am-picture-pair{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}
html body #gameEngine #gameContent#gameContent .am-picture-pair a{display:flex;flex-direction:column;gap:8px;text-align:center;min-width:0}
html body #gameEngine #gameContent#gameContent .am-picture-pair img{width:100%;height:420px;object-fit:contain;background:#eff7fa;border-radius:14px}
html body #gameEngine #gameContent#gameContent .am-picture-pair img[hidden],html body #gameEngine #gameContent#gameContent .am-picture-unavailable[hidden]{display:none}
html body #gameEngine #gameContent#gameContent .am-picture-credit{font-size:.85rem;line-height:1.5;color:var(--am-muted)}
html body #gameEngine #gameContent#gameContent .am-attachment-summary{margin:18px 0;padding:16px;border-left:4px solid var(--am-edge);background:var(--am-panel);color:var(--am-ink);border-radius:10px}
html body #gameEngine #gameContent#gameContent .am-attachment-summary dt{font-weight:800;margin-top:10px}
html body #gameEngine #gameContent#gameContent .am-attachment-summary dd{margin:4px 0 12px;line-height:1.6}
@media(min-width:1200px){html body #gameEngine #gameContent#gameContent .am-play-layout:has(.am-pictures){grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
@media(max-width:600px){html body #gameEngine #gameContent#gameContent .am-picture-pair{grid-template-columns:1fr}html body #gameEngine #gameContent#gameContent .am-picture-pair img{height:320px}}
