.ri-mobile-game-nav{display:none}
.ri-mobile-game-start{display:inline-flex;min-height:54px;align-items:center;justify-content:center;margin-top:20px;padding:0 26px;border:0;border-radius:18px;color:#fff;background:linear-gradient(135deg,#7650d7,#9565e8);box-shadow:0 12px 24px rgba(91,57,170,.24);font:900 16px/1 Nunito,"Trebuchet MS",Arial,sans-serif;cursor:pointer}
html.ri-mobile-game-open{margin-top:0!important;overflow:hidden!important}
body.ri-mobile-game-open{overflow:hidden!important;padding-top:0!important}
html.ri-mobile-game-open #wpadminbar{display:none!important}
@media (max-width:680px),(hover:none) and (max-width:1100px){
  .ri-mobile-game-nav.is-visible{position:fixed;z-index:100200;top:0;right:0;left:0;display:flex!important;width:100%;min-height:52px;align-items:flex-end;padding:calc(7px + env(safe-area-inset-top)) calc(7px + env(safe-area-inset-right)) 6px calc(7px + env(safe-area-inset-left));background:#fff;box-shadow:0 5px 16px rgba(60,38,108,.12)}
  .ri-mobile-game-nav a{display:flex;width:100%;min-height:39px;align-items:center;justify-content:center;gap:8px;padding:0 14px;border-radius:13px;color:#fff!important;background:linear-gradient(135deg,#7650d7,#9565e8);box-shadow:0 7px 16px rgba(91,57,170,.24);font:900 12px/1 Nunito,"Trebuchet MS",Arial,sans-serif;text-align:center;text-decoration:none!important;-webkit-tap-highlight-color:transparent}
  .ri-mobile-game-nav a span{font-size:20px;line-height:1}
  .ri-mobile-playing .ri-mobile-hide-on-play{display:none!important}
  .ri-mobile-playing [class*="mobile-exit"]{display:none!important}
  .ri-mobile-game-workspace.ri-mobile-workspace-active{position:fixed!important;z-index:100100!important;top:var(--ri-mobile-nav-height,52px)!important;right:auto!important;bottom:auto!important;left:0!important;box-sizing:border-box!important;max-width:none!important;max-height:none!important;margin:0!important;overflow:hidden!important;border-radius:0!important;background:#fff!important;box-shadow:none!important;transform-origin:top left!important;touch-action:manipulation}
  .ri-mobile-playing .ri-mobile-completion:not([hidden]){z-index:100300!important}
  .ri-mobile-playing button,.ri-mobile-playing [role="button"]{-webkit-tap-highlight-color:transparent}
  .ri-mobile-game-start{width:100%;min-height:52px}

  /* «Чей домик?»: самостоятельная компоновка без масштабирования всего полотна. */
  .riwh-game.ri-mobile-playing .riwh-workshop.ri-mobile-workspace-active{
    display:flex!important;
    flex-direction:column!important;
    padding:0 7px 7px!important;
  }
  .riwh-game.ri-mobile-playing .riwh-workshop-head{
    flex:0 0 auto;
    align-items:center;
    gap:7px;
    padding:7px 5px 5px;
  }
  .riwh-game.ri-mobile-playing .riwh-workshop-head>div:first-child span{font-size:8px;letter-spacing:.07em}
  .riwh-game.ri-mobile-playing .riwh-workshop-head h2{margin-top:1px;font-size:19px;line-height:1.05}
  .riwh-game.ri-mobile-playing .riwh-stats{flex-direction:row;gap:5px}
  .riwh-game.ri-mobile-playing .riwh-stats>span{min-width:61px;padding:4px 6px;border-radius:11px}
  .riwh-game.ri-mobile-playing .riwh-stats small{font-size:8px;line-height:1}
  .riwh-game.ri-mobile-playing .riwh-stats b{font-size:13px;line-height:1.15}
  .riwh-game.ri-mobile-playing .riwh-progress{flex:0 0 6px;height:6px;margin:0 5px 6px}
  .riwh-game.ri-mobile-playing .riwh-play{
    display:grid;
    flex:1 1 auto;
    grid-template-rows:auto minmax(0,1fr) auto;
    gap:6px;
    min-height:0;
    padding:0;
  }
  .riwh-game.ri-mobile-playing .riwh-levels{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:5px;
    padding:0;
  }
  .riwh-game.ri-mobile-playing .riwh-levels button{
    min-height:39px;
    padding:5px 3px;
    border-radius:12px;
    text-align:center;
  }
  .riwh-game.ri-mobile-playing .riwh-levels b{font-size:12px;line-height:1.1}
  .riwh-game.ri-mobile-playing .riwh-levels span{margin-top:2px;font-size:7px;line-height:1.05}
  .riwh-game.ri-mobile-playing .riwh-instruction{display:none}
  .riwh-game.ri-mobile-playing .riwh-scene{
    display:flex;
    min-height:0;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    padding:6px;
    border-radius:17px;
  }
  .riwh-game.ri-mobile-playing .riwh-board-wrap{
    display:flex;
    max-width:100%;
    max-height:100%;
    flex:0 0 auto;
    align-items:stretch;
    padding:5px;
    border-width:2px;
    border-radius:15px;
  }
  .riwh-game.ri-mobile-playing .riwh-board{
    width:100%;
    height:100%;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:5px;
  }
  .riwh-game.ri-mobile-playing .riwh-board[data-cards="8"]{grid-template-rows:repeat(2,minmax(0,1fr))}
  .riwh-game.ri-mobile-playing .riwh-board[data-cards="12"]{grid-template-rows:repeat(3,minmax(0,1fr))}
  .riwh-game.ri-mobile-playing .riwh-board[data-cards="16"]{grid-template-rows:repeat(4,minmax(0,1fr))}
  .riwh-game.ri-mobile-playing .riwh-card{min-height:0;aspect-ratio:auto;border-radius:10px}
  .riwh-game.ri-mobile-playing .riwh-card-back,
  .riwh-game.ri-mobile-playing .riwh-card-front{border-width:2px;border-radius:10px}
  .riwh-game.ri-mobile-playing .riwh-card-front{min-height:0;padding:2px}
  .riwh-game.ri-mobile-playing .riwh-card-front img{min-height:0;height:calc(100% - 14px)}
  .riwh-game.ri-mobile-playing .riwh-card-front strong{font-size:8px;line-height:11px}
  .riwh-game.ri-mobile-playing .riwh-workshop-foot{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:6px;
    padding:0;
  }
  .riwh-game.ri-mobile-playing .riwh-workshop-foot p{
    min-height:0;
    overflow:hidden;
    font-size:10px;
    line-height:1.15;
    text-align:left;
    text-overflow:ellipsis;
  }
  .riwh-game.ri-mobile-playing .riwh-workshop-foot button{
    width:auto;
    min-height:35px;
    padding:6px 9px;
    border-radius:11px;
    font-size:9px;
  }
}

