* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #231F20;
}

#unity-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#unity-canvas-wrapper {
  position: relative;
  width: 100%;
  height: calc(100% - 38px); /* Reserve space for footer */
  display: flex;
  align-items: center;
  justify-content: center;
}

#unity-canvas {
  background: #231F20;
  /* Max size is the reference resolution, scaled down to fit */
  max-width: 100%;
  max-height: 100%;
  /* Maintain 16:9 aspect ratio */
  aspect-ratio: 16 / 9;
}

/* Fullscreen mode: no footer, canvas fills everything */
:fullscreen #unity-canvas-wrapper,
:-webkit-full-screen #unity-canvas-wrapper {
  height: 100%;
}

:fullscreen #unity-footer,
:-webkit-full-screen #unity-footer {
  display: none;
}

/* Loading bar - 加大 + 文字提示, 让用户首次访问期间能看到进度 */
#unity-loading-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 10;
  text-align: center;
  width: 360px;
  font-family: "Microsoft YaHei", "PingFang SC", arial, sans-serif;
  color: #ddd;
}

#unity-logo {
  width: 154px;
  height: 130px;
  background: url('unity-logo-dark.png') no-repeat center;
  margin: 0 auto 12px;
}

/* 主标题: 阶段文案 (正在加载 / 正在启动) */
#loading-stage {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

/* 副标题: 提示首次较慢, 二次访问会快 */
#loading-hint {
  font-size: 12px;
  color: #888;
  margin-bottom: 14px;
  line-height: 1.6;
}

/* 进度条 — 比 Unity 默认那个大很多 */
#unity-progress-bar-empty {
  width: 320px;
  height: 8px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

#unity-progress-bar-full {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #4ec9b0, #6abf69);
  transition: width 0.2s ease-out;
}

/* 百分比数字 */
#loading-percent {
  font-size: 11px;
  color: #888;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* Footer */
#unity-footer {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: #231F20;
  flex-shrink: 0;
}

#unity-logo-title-footer {
  width: 102px;
  height: 38px;
  background: url('unity-logo-title-footer.png') no-repeat center;
  margin-right: auto;
}

#unity-build-title {
  margin-right: 10px;
  line-height: 38px;
  font-family: arial, sans-serif;
  font-size: 14px;
  color: #999;
}

#unity-fullscreen-button {
  cursor: pointer;
  width: 38px;
  height: 38px;
  background: url('fullscreen-button.png') no-repeat center;
  flex-shrink: 0;
}

/* Warning banner */
#unity-warning {
  position: absolute;
  left: 50%;
  top: 5%;
  transform: translate(-50%);
  background: white;
  padding: 10px;
  display: none;
  z-index: 20;
}

/* Mobile */
#unity-container.unity-mobile #unity-footer {
  display: none;
}

#unity-container.unity-mobile #unity-canvas-wrapper {
  height: 100%;
}

#unity-container.unity-mobile #unity-canvas {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}
