/* A game on a phone, once it starts (phone-bar.js adds html.gw-slim and the bar): a slim bar instead of the
   site's top bar, and the game fills the rest. The bar stays on the same edge of the phone, so sideways it runs down the
   side (data-bar-side: left or right) and the game gets the whole height. Exit is always first: left, or on top. */
html.gw-slim,html.gw-slim body{overflow:hidden;height:100%}
html.gw-slim .top{display:none}
html.gw-slim .gw-frame{--slim:calc(38px + env(safe-area-inset-top));position:fixed;inset:0;z-index:50;width:auto;max-width:none;margin:0;padding-top:var(--slim);
  border:0;border-radius:0;box-shadow:none;display:flex;flex-direction:column;background:#0b0a10}
html.gw-slim .gw-frame .game{flex:1;height:auto;min-height:0;max-height:none}
html.gw-slim .gw-frame .gw-bar{display:none}
.slim-bar{position:absolute;top:0;left:0;right:0;z-index:15;height:var(--slim);display:flex;align-items:center;justify-content:space-between;
  padding:env(safe-area-inset-top) 6px 0;background:#0b0a10}
.slim-exit,.slim-full{position:relative;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:9px;cursor:pointer;-webkit-tap-highlight-color:transparent}
.slim-exit::after,.slim-full::after{content:"";position:absolute;inset:-5px}     /* a bigger area to tap than to see */
.slim-exit svg,.slim-full svg{flex:none;width:18px;height:18px}
.slim-exit{gap:5px;height:28px;padding:0 10px 0 8px;background:var(--mogi,#FFD60A);color:#16141d;font:700 13.5px/1 "Plus Jakarta Sans",system-ui,sans-serif;text-decoration:none}
.slim-full{width:30px;height:30px;padding:0;background:#ffffff1f;color:#fff}
.slim-leave,.gw-frame.is-max .slim-enter{display:none}
.gw-frame.is-max .slim-leave{display:block}
.slim-exit:focus-visible,.slim-full:focus-visible{outline:3px solid #00F0FF;outline-offset:2px}
/* where the phone blocks full screen, its button shows this for a few seconds; taps go through to the game */
.slim-tip{position:absolute;top:calc(var(--slim) + 6px);right:6px;z-index:16;width:min(250px,calc(100% - 12px));padding:10px 12px;border-radius:12px;background:#0b0a10f2;color:#fff;
  box-shadow:0 6px 18px #0007;pointer-events:none;font:600 13px/1.35 "Plus Jakarta Sans",system-ui,sans-serif}
@media (orientation:landscape){
  /* the far side keeps clear of the phone's rounded corners and camera too, so nothing there gets cut off */
  html.gw-slim .gw-frame{--slim:calc(38px + env(safe-area-inset-left));padding:0 env(safe-area-inset-right) 0 var(--slim)}
  html.gw-slim .gw-frame[data-bar-side=right]{--slim:calc(38px + env(safe-area-inset-right));padding:0 var(--slim) 0 env(safe-area-inset-left)}
  .slim-tip{top:auto;right:auto;bottom:6px;left:calc(var(--slim) + 6px)}
  .gw-frame[data-bar-side=right] .slim-tip{left:auto;right:calc(var(--slim) + 6px)}
  .slim-bar{right:auto;bottom:0;width:var(--slim);height:auto;flex-direction:column;padding:6px 0 6px env(safe-area-inset-left)}
  .gw-frame[data-bar-side=right] .slim-bar{left:auto;right:0;padding:6px env(safe-area-inset-right) 6px 0}
  .slim-exit{flex-direction:column;gap:2px;width:32px;height:44px;padding:0;font-size:10.5px}
  .slim-exit svg{width:17px;height:17px}
}

/* "Rotate your phone": top middle of a sideways-made game, only on an upright screen once the game has started (phone-bar.js
   adds it). On a phone it sits right under the slim bar. A tiny strip of game grows to fill the phone's screen as it turns.
   Taps go through to the game, except on the X. */
.rotate-sign{--rotate-top:212px;display:none;position:absolute;top:var(--rotate-top);left:0;right:0;width:fit-content;margin-inline:auto;z-index:14;align-items:stretch;
  border-radius:17px;overflow:hidden;background:#0b0a10d9;color:#fff;box-shadow:0 6px 18px #0007;pointer-events:none;
  font:700 15.6px/1.2 "Plus Jakarta Sans",system-ui,sans-serif;animation:rotateSignIn .3s cubic-bezier(.2,.8,.2,1) both}
@media (orientation:portrait) and (max-width:500px){.rotate-sign{display:flex}}    /* phones only: a tablet held upright has room to spare */
@media (pointer:coarse){.rotate-sign{--rotate-top:95px}}    /* touch screens have no rear-view mirror, so it sits higher */
html.gw-slim .rotate-sign{--rotate-top:calc(var(--slim) + 8px)}
.rotate-icon{flex:none;width:46px;height:46px;margin:11px 7px 11px 11px;overflow:visible}
.rotate-phone,.rotate-fill,.rotate-play{transform-box:fill-box;transform-origin:center;animation:3.4s infinite}
.rotate-phone{animation-name:rotatePhone}
.rotate-fill{fill:var(--mogi,#FFD60A);stroke:none;animation-name:rotateFill}
.rotate-play{fill:#16141d;stroke:none;animation-name:rotatePlay}
.rotate-text{align-self:center;width:62px;padding-right:11px}
.rotate-close{flex:none;display:grid;place-items:center;width:41px;border:0;padding:0;background:#ffffff14;color:#fff;cursor:pointer;
  pointer-events:auto;-webkit-tap-highlight-color:transparent}
.rotate-close svg{width:19px;height:19px}
.rotate-close:hover{background:#ffffff2b}
.rotate-close:focus-visible{outline:3px solid #00F0FF;outline-offset:-3px}
@keyframes rotateSignIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
@keyframes rotatePhone{0%,18%{transform:rotate(0);animation-timing-function:cubic-bezier(.65,0,.35,1)}42%{transform:rotate(100deg);animation-timing-function:ease-in-out}50%,84%{transform:rotate(90deg);animation-timing-function:cubic-bezier(.65,0,.35,1)}100%{transform:rotate(0)}}
@keyframes rotateFill{0%,30%{transform:scaleY(.24);animation-timing-function:ease-in-out}52%,84%{transform:scaleY(1);animation-timing-function:ease-in-out}100%{transform:scaleY(.24)}}
@keyframes rotatePlay{0%,44%{opacity:0;transform:scale(.3)}56%{opacity:1;transform:scale(1.25)}62%,84%{opacity:1;transform:scale(1)}90%,100%{opacity:0;transform:scale(.3)}}
@media (prefers-reduced-motion:reduce){.rotate-sign,.rotate-phone,.rotate-fill,.rotate-play{animation:none}.rotate-phone{transform:rotate(90deg)}}
