html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #07111f;
  color: #eef5ff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
}

#app-shell {
  position: fixed;
  inset: 0;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(33, 55, 94, 0.92), rgba(8, 16, 28, 0.96)),
    radial-gradient(circle at 50% 18%, rgba(69, 132, 255, 0.22), transparent 32%);
}

#unity-container {
  position: relative;
  width: min(100vw, 160vh);
  width: min(100dvw, 160dvh);
  height: min(100vh, 62.5vw);
  height: min(100dvh, 62.5dvw);
  aspect-ratio: 8 / 5;
  overflow: hidden;
}

#app-shell:fullscreen,
#app-shell:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  background: #07111f;
}

#unity-canvas {
  width: 100%;
  height: 100%;
  background: transparent;
}

#unity-loading-bar {
  position: absolute;
  inset: 0;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
  background: rgba(7, 17, 31, 0.82);
}

.loading-brand {
  font-size: 14px;
  font-weight: 800;
  color: #8db6ff;
}

.loading-title {
  font-size: 28px;
  font-weight: 900;
  color: #ffffff;
}

.loading-tip {
  font-size: 13px;
  color: #b8c9e6;
}

.loading-recovery {
  max-width: min(78vw, 520px);
  color: #dbe8ff;
  font-size: 13px;
  line-height: 1.6;
}

.loading-recovery[hidden] {
  display: none;
}

.loading-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.loading-actions button {
  min-width: 112px;
  padding: 10px 16px;
  border: 1px solid rgba(141, 182, 255, 0.6);
  border-radius: 8px;
  background: #235ecf;
  color: #ffffff;
  font: 700 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  cursor: pointer;
}

.loading-actions button:last-child {
  background: rgba(7, 17, 31, 0.72);
}

.loading-actions button:hover {
  border-color: #dbe8ff;
  filter: brightness(1.08);
}

#unity-progress-bar-empty {
  width: min(70vw, 360px);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

#unity-progress-bar-full {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: #2f73ff;
}

#unity-warning {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 16px;
  z-index: 10000;
}

#fullscreen-button {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  top: max(14px, env(safe-area-inset-top));
  z-index: 20000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 88px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(173, 205, 255, 0.36);
  border-radius: 10px;
  background: rgba(5, 14, 27, 0.78);
  color: #ffffff;
  font: 700 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(8px);
}

#fullscreen-button[hidden] {
  display: none;
}

#fullscreen-button:hover {
  background: rgba(24, 58, 111, 0.9);
  border-color: rgba(173, 205, 255, 0.68);
}

#fullscreen-button:focus-visible {
  outline: 2px solid #8db6ff;
  outline-offset: 2px;
}

.fullscreen-icon {
  width: 15px;
  height: 15px;
  border: solid currentColor;
  border-width: 2px 0 0 2px;
  box-shadow: 5px 5px 0 -3px #ffffff;
  transform: rotate(0deg);
}

#fullscreen-button.is-fullscreen .fullscreen-icon {
  transform: rotate(180deg);
}

#orientation-tip {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30000;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: rgba(5, 14, 27, 0.96);
  color: #dbe8ff;
  backdrop-filter: blur(8px);
}

.orientation-card {
  width: min(84vw, 360px);
  padding: 28px 24px;
  border: 1px solid rgba(141, 182, 255, 0.44);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(23, 54, 101, 0.94), rgba(7, 17, 31, 0.98));
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.orientation-icon {
  margin-bottom: 12px;
  color: #8db6ff;
  font-size: 48px;
  line-height: 1;
}

.orientation-title {
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
}

.orientation-detail {
  margin-top: 8px;
  color: #b8c9e6;
  font-size: 14px;
  line-height: 1.5;
}

@media (orientation: portrait) and (max-width: 900px) {
  #orientation-tip {
    display: grid;
  }
}

@media (max-width: 640px), (max-height: 480px) {
  #fullscreen-button {
    min-width: 42px;
    width: 42px;
    padding: 0;
  }

  #fullscreen-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.unity-banner {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #ffffff;
}

.unity-banner.error {
  background: #c4382f;
}

.unity-banner.warning {
  background: #8b6b1a;
}
