/* The emulator page (the emulator host's one page: site/src/pages.js emuPage, emu.js). Tokens are kit.css's.
   The panel is 1280 by 820 and wants the whole screen:
   - a wide screen: as large as fits under the strip;
   - a phone on its side: the panel fills the height and the strip goes below it;
   - a phone held upright: the panel is turned a quarter and laid along the phone, so each key is as wide as it is with
     the phone on its side (about 25 px on a 390 px phone, against 18 px upright). The person turns the phone, not the
     browser, so a rotation lock does not matter. emu.js maps a finger back through the turn. */
.emu .frame{display:flex;flex-direction:column;min-height:100vh;min-height:100dvh}
.emu main{display:contents}
.emutop{display:flex;align-items:center;gap:10px;height:48px;flex:none;padding:0 12px;background:var(--grey);color:var(--paper)}
.emutop .logo{width:98px;height:32px}
.emutop .tag{font:600 13px/1 var(--fd);letter-spacing:.08em;text-transform:uppercase;background:var(--spray);color:#1F1C1B;padding:6px 8px}
.emutop .fwname{color:inherit;text-decoration:underline;text-underline-offset:4px;padding:14px 0;font:600 16px/1.1 var(--fd);margin-left:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.emu .stage{padding:0;position:relative;flex:none;align-self:center;width:min(100%,calc((100vh - 48px)*1.561),1280px);width:min(100%,calc((100dvh - 48px)*1.561),1280px);aspect-ratio:1280/820;background:#17181b}
.stage canvas{display:block;width:100%;height:100%;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;cursor:pointer}
.stage #start{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);min-width:9em;min-height:64px;font-size:24px;box-shadow:0 0 0 6px rgba(23,24,27,.55)}
.stage[aria-busy="true"] #start{opacity:.55}
.emu .err{margin:10px 16px 0;font:600 16px/1.35 var(--fb);color:var(--deep)}
.emulist{width:100%;max-width:760px;padding-top:14px;scroll-margin-top:0;padding-bottom:36px}
.emulist .buildlist .src{font:500 14px/1 var(--fb);color:var(--mute);text-decoration:underline;display:inline-block;padding:14px 0 14px 6px}
.emulist .buildlist .fw{font:500 14px/1.3 var(--fb);color:var(--mute)}
.emulist .credit a{display:inline-block;padding:12px 0}
@media (orientation:landscape) and (max-height:520px){
  .stage{order:-1;width:min(100%,calc(100vh*1.561));width:min(100%,calc(100dvh*1.561))}
}
@media (orientation:portrait) and (max-width:600px){
  /* (72 px left under the panel: the builds' band shows there, and it is where a thumb can swipe the page) */
  .emu .stage{--L:min(calc(100vh - 120px),calc(100vw*1.561));--L:min(calc(100dvh - 120px),calc(100vw*1.561));width:calc(var(--L)/1.561);height:var(--L);aspect-ratio:auto}
  .stage canvas{position:absolute;left:0;top:0;width:var(--L);height:calc(var(--L)/1.561);transform-origin:0 0;transform:translateX(calc(var(--L)/1.561)) rotate(90deg)}
}
