/* 720×1280 固定基準。実際のスケーリングは JS 側で調整する */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1a1a;
  display: flex;
  justify-content: center;
  align-items: center;
  /* iOS Safari タッチイベント対策 */
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: none;
}

#unity-container {
  position: relative;
  width: 720px;
  height: 1280px;
  background: #1a1a1a;
  /* iOS Safari タッチイベント対策 */
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  user-select: none;
  pointer-events: auto;
}

#unity-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #1a1a1a;
  touch-action: none; /* ブラウザのタッチジェスチャー（スクロール等）を無効化してUnityのタッチイベント処理を優先 */
  /* iOS Safari タッチイベント対策 */
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  user-select: none;
  pointer-events: auto;
}

#unity-loading-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#unity-logo {
  width: 200px;
  height: 200px;
  background: url('logo_blackBack.png') no-repeat center / contain;
  margin-bottom: 30px;
}

#unity-progress-bar-empty {
  width: 60%;
  max-width: 400px;
  height: 24px;
  border: 2px solid #0FF;
  box-sizing: border-box;
  position: relative;
  margin-top: 10px;
  border-radius: 4px;
}

#unity-progress-bar-full {
  width: 0%;
  height: 100%;
  background-color: #0FF;
  transition: width 0.4s ease-out;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 2px;
}

#progress-text {
  margin-top: 10px;
  font-size: 18px;
  color: #FFF;
  font-family: 'Arial', sans-serif;
}

#unity-warning {
  position: absolute;
  top: 10px;
  left: 10px;
  width: calc(100% - 20px);
  display: none;
  z-index: 10000;
}

.browser-back-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  z-index: 100000;
}

.browser-back-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.browser-back-modal__content {
  width: 100%;
  max-width: 360px;
  background: #ffffff;
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  font-family: 'Arial', sans-serif;
}

.browser-back-modal__message {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.6;
  color: #1a1a1a;
}

.browser-back-modal__actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.browser-back-modal__button {
  flex: 1;
  padding: 12px 16px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Arial', sans-serif;
  transition: background 0.2s ease, color 0.2s ease;
}

.browser-back-modal__button--cancel {
  background: #f0f0f0;
  color: #1a1a1a;
}

.browser-back-modal__button--cancel:hover {
  background: #e0e0e0;
}

.browser-back-modal__button--confirm {
  background: #00bcd4;
  color: #ffffff;
}

.browser-back-modal__button--confirm:hover {
  background: #00a0b5;
}

#unity-warning > div {
  padding: 10px;
  margin-bottom: 5px;
  border-radius: 4px;
  color: #000;
  font-family: 'Arial', sans-serif;
}

#unity-footer {
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  box-sizing: border-box;
}

#unity-warning {
  position: absolute;
  top: 10px;
  left: 10px;
  width: calc(100% - 20px);
  display: none;
  z-index: 10000;
}
