     window.removeEventListener 'game.start', adjustSize
     window.removeEventListener 'game.payitem', adjustPayitem
     $('kan-game webview').removeEventListener 'page-title-set', handleTitleSet
-    $('kan-game #webview-wrapper')?.style?.height = $('kan-game webview')?.style?.height = $('kan-game webview /deep/ object[is=browserplugin]')?.style?.height = "#{window.innerWidth / 800.0 * 480.0 - 5}px"
+    adjustWebviewHeight "#{window.innerWidth / 800.0 * 480.0 - 5}px"
     $('kan-game #webview-wrapper')?.style?.width = ""
     $('kan-game #webview-wrapper')?.style?.marginLeft = ""
     window._delay = true

{$, $$} = window

# Initial
$('kan-game webview')?.style?.height = $('kan-game webview /deep/ object[is=browserplugin]')?.style?.height = "#{window.innerWidth / 800.0 * 480.0}px"
$('#layout-css').setAttribute 'href', "./assets/css/layout.vertical.css"

# Layout
adjustSize = ->
  webview = $('kan-game webview')
  poiapp = document.getElementsByTagName('poi-app')[0]

      y: bound.y
      width: parseInt(newWidth + borderX)
      height: bound.height
  adjustWebviewHeight "#{480.0 * factor - 1}px"
  $('kan-game #webview-wrapper')?.style?.width = "#{800 * factor}px"
  $('kan-game #webview-wrapper')?.style?.marginLeft = "#{Math.max(0, window.innerWidth - 800 * factor - 1) / 2}px"
  return if url != 'http://www.dmm.com/netgame/social/-/gadgets/=/app_id=854854/' and !(url?.startsWith('http://osapi.dmm.com/gadgets/ifr'))
