
@media (orientation:portrait) and (max-width:740px){
  body:is(.gate-active,.cart-active,.puppet-active,.rail-active,.wheel-active) #art-frame #scene{
    position:fixed;inset:50% auto auto 50%;transform:translate(-50%,-50%);
    width:max(100vw,calc(100dvh * 841 / 1870));height:auto;aspect-ratio:841 / 1870;
    clip-path:none;border-radius:0;box-shadow:none;
  }
  body:is(.gate-active,.cart-active,.puppet-active,.rail-active,.wheel-active) #art-frame #game .heading{
    inset:clamp(57px,10dvh,98px) var(--phone-side) auto;transform:none;
    background:#45224de8;min-height:0;
  }
  body:is(.gate-active,.cart-active,.puppet-active,.rail-active) #art-frame #gate-answers{
    inset:auto 10px max(78px,12%) 10px;
  }
  body:is(.gate-active,.cart-active,.puppet-active,.rail-active) #art-frame #gate-answers > button{
    min-height:49px;box-shadow:0 3px 0 #321735a8;
  }
  .gate-picture,.gate-open-picture,.cart-picture,.cart-road,.puppet-picture,.rail-picture,.rail-finish-picture,.wheel-picture{
    width:100%;height:100%;object-fit:contain!important;
  }
  .gate-light,.gate-panes,.gate-lock{display:none}
  body.gate-active #scene.success .gate-open-picture{animation-delay:.38s;animation-duration:1s}
  .cart-moving-group{left:16%;top:44%;width:75%;height:28%}
  .cart-sprite{height:77%}
  .cart-spoked-wheel{top:60%;height:34%;width:28%}
  .cart-spoked-wheel.rear{left:3%}
  .cart-spoked-wheel.front{right:3%}
  .cart-ground-shadow{bottom:5%}
  .puppet-dancers i{background-image:url("../phone/puppet.webp")}
  .wheel-solved .ride-show picture img{object-fit:cover}
  .wheel-active .ride-ring{height:auto;width:68%;top:52%;border-width:6px}
  .wheel-active .ride-stand{top:52%;height:27%;width:36%}
  .wheel-active .ride-hub{top:52%;width:13%}
  .wheel-active .ride-light{box-shadow:0 0 10px #ffcf67}
  .count-art{object-fit:cover}
  .value-active #art-frame #scene{background-image:url("../phone/count.webp");background-size:cover}
  .count-active #art-frame .count-board{background:#40204b55;border-radius:20px}
  @media(max-height:630px){
    body:is(.gate-active,.cart-active,.puppet-active,.rail-active,.wheel-active) #art-frame #game .heading{
      inset:57px var(--phone-side) auto;padding:.3rem .45rem
    }
  }
}


@media (orientation:portrait) and (max-width:740px){
  body.cover-active #art-frame #cover{width:max(100vw,calc(100dvh * 841 / 1870))}
  body.cover-active #cover .cover-title{inset-inline:9%}
  .wheel-active #art-frame .bulb{left:var(--phone-x);top:var(--phone-y);width:44px;height:44px}
  .wheel-active #art-frame .bulb:nth-child(1){--phone-x:50%;--phone-y:31.8%}
  .wheel-active #art-frame .bulb:nth-child(2){--phone-x:83.25%;--phone-y:43.6%}
  .wheel-active #art-frame .bulb:nth-child(3){--phone-x:73.3%;--phone-y:60.6%}
  .wheel-active #art-frame .bulb:nth-child(4){--phone-x:26.9%;--phone-y:60.6%}
  .wheel-active #art-frame .bulb:nth-child(5){--phone-x:16.75%;--phone-y:43.6%}
  .wheel-active #art-frame .bulb.lit::after{inset:18%}
  .rail-active #art-frame .slot{left:calc(56% - var(--phone-coach-index) * 16.2%);top:58.7%;width:14%;height:5.2%}
  .rail-active #art-frame .slot.filled{border-width:2px}
  .rail-active #art-frame .slot.filled::before{border-width:1px}
  .rail-solved #art-frame .slot{top:62%}
  .rail-active #art-frame .engine{
    background-image:url("../phone/rail-portrait.webp");
    clip-path:polygon(73% 53.9%,80.5% 53.9%,81% 56%,85.5% 56%,87% 56.4%,90.5% 57.5%,94.6% 62.8%,95% 64.3%,73.8% 64.3%);
  }
  .rail-solved #art-frame .engine{transform:translateY(3.3%)}
  .rail-active #art-frame .train.depart::after{left:81%;top:56%;width:10%;height:4%}
  .puppet-curtain{clip-path:polygon(15% 44%,87% 44%,89% 64%,12% 64%)}
  .puppet-dancers i:nth-child(1){clip-path:polygon(15% 64%,14% 50%,23% 46%,31% 46%,39% 52%,37% 64%);transform-origin:27% 63%}
  .puppet-dancers i:nth-child(2){clip-path:polygon(38% 64%,38% 51%,43% 46%,56% 46%,61% 52%,61% 64%);transform-origin:50% 63%}
  .puppet-dancers i:nth-child(3){clip-path:polygon(62% 64%,61% 50%,65% 44%,76% 44%,82% 50%,85% 53%,85% 64%);transform-origin:74% 63%}
}
