html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #FFF;
  touch-action: none;
}
#unity-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
  background: url('title_01_background.png') no-repeat center;
  background-size: cover;
}
#unity-container.unity-desktop { left: 50%; top: 50%; transform: translate(-50%, -50%) }
#unity-container.unity-mobile { position: fixed; width: 100%; height: 100% }
#unity-canvas {
  display: block;
  max-width: 960px;
  max-height: 540px;
  aspect-ratio: 16 / 9;
  background: #000;
}
.unity-mobile #unity-canvas {
  display: block;
  width: min(100vw - (env(safe-area-inset-left) + env(safe-area-inset-right)),
             (100dvh - (env(safe-area-inset-top) + env(safe-area-inset-bottom))) * (16 / 9));
  height: auto;
  aspect-ratio: 16 / 9;
}
#unity-footer { position: relative }
.unity-mobile #unity-footer { position: absolute; right: 10px; bottom: 10px; }
/* .unity-mobile #unity-footer { display: none; } */
#unity-logo-title-footer { float:left; width: 102px; height: 38px; background: url('unity-logo-title-footer.png') no-repeat center }  /* 枠外左下の画像 */
#unity-build-title { float: right; margin-right: 10px; line-height: 38px; font-family: arial; font-size: 18px }
#unity-fullscreen-button {
  cursor:pointer;
  float: right;
  width: 38px;
  height: 38px;
  background: url('fullscreen-button.png') no-repeat center;

  border-radius: 10px;                 /* 丸み */
  border: 2px solid rgba(255,255,255,0.9); /* 枠 */
  background-color: rgba(0,0,0,0.4);   /* 背景を半透明に */
  backdrop-filter: blur(4px);          /* ガラスっぽく（対応端末のみ） */

  display: flex;
  align-items: center;
  justify-content: center;
}
#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }


/* 横持ちを促すオーバーレイ */
#rotate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  pointer-events: auto;
  touch-action: none;
  -ms-touch-action: none;
}
.unity-mobile #rotate-overlay .rotate-box {
  color: #fff;
  text-align: center;
  padding: 24px 32px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px;
  backdrop-filter: blur(4px);
}
.unity-mobile #rotate-overlay .rotate-icon {
  left: auto;
  right: auto;
}
.unity-mobile #rotate-overlay .rotate-text {
  font-size: 16px;
  line-height: 1.6;
}
.unity-mobile #rotate-overlay.show {
  display: flex;
}



/* 既定のローディングUIを隠す */
#unity-loading-bar,
#unity-warning,
#unity-logo {
  display: none !important;
}

#canvas-wrap {
  position: relative;
  display: block;
  margin: auto;
  line-height: 0;
}

#canvas-wrap #custom-loading {
  position: absolute;
  right: 50px;
  bottom: 38px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
}

#loading-text {
  height: 24px;
}
.loading-dots {
  height: 10px;
}
#loading-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  height: 3px;
  background: #FFF;
  opacity: 0.7;
  pointer-events: none;
  z-index: 15;
}

/* iOS Safari用：スクロールできる状態を作る */
body.ios-expand {
  overflow: auto;
  height: auto;
  -webkit-overflow-scrolling: touch;
}

body.ios-expand #unity-container {
  position: relative !important;
  height: 100dvh;
}

#ios-scroll-pad {
  height: 2px;
  background: #000;
  pointer-events: none;
}
